Skip to content

Commit

Permalink
scoped down exception handling
Browse files Browse the repository at this point in the history
  • Loading branch information
Vzor- committed Apr 27, 2024
1 parent 85be03c commit 6943235
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/qz/utils/PrintingUtilities.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
public class PrintingUtilities {

private static final Logger log = LogManager.getLogger(PrintingUtilities.class);
private static final String PRINT_SERVICE_MESSAGE = "PrintService is no longer available.";

private static GenericKeyedObjectPool<Format,PrintProcessor> processorPool;

Expand Down Expand Up @@ -214,6 +215,8 @@ public static void processPrintRequest(Session session, String UID, JSONObject p
try {
processor.print(output, options);
} catch (PrinterException e) {
// e.getMessage() can be null, do not reverse this comparison
if (!PRINT_SERVICE_MESSAGE.equals(e.getMessage())) throw e;
// https://github.com/qzind/tray/issues/1259
log.info("Print Failed, retrying with a new PrintService");
output.refreshPrintService();
Expand Down

0 comments on commit 6943235

Please sign in to comment.