Skip to content

Commit

Permalink
Also better response on error
Browse files Browse the repository at this point in the history
  • Loading branch information
sbrunner committed Mar 31, 2021
1 parent defa85a commit 03a4128
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions core/src/main/java/org/mapfish/print/servlet/job/PrintJob.java
Original file line number Diff line number Diff line change
Expand Up @@ -164,19 +164,23 @@ public final PrintJobResult call() throws Exception {
null :
createResult(fileName, fileExtension, mimeType);
} catch (Exception e) {
String canceledText = "";
if (Thread.currentThread().isInterrupted()) {
canceledText = "(canceled) ";
LOGGER.info(
"Print job canceled {}\n{}",
this.entry.getRequestData(), this.entry.getReferenceId()
);
this.metricRegistry.counter(getClass().getName() + ".canceled").inc();
jobTracker.onJobCancel();
} else {
LOGGER.warn(
"Error executing print job {}\n{}",
this.entry.getRequestData(), this.entry.getReferenceId(), e
);
this.metricRegistry.counter(getClass().getName() + ".error").inc();
jobTracker.onJobError();
}
deleteReport();
maybeSendError(mapPrinter.getConfiguration(), e);
LOGGER.warn("Error executing print job {} {}\n{}",
this.entry.getRequestData(), canceledText, this.entry.getReferenceId(), e);
throw e;
} finally {
final long totalTimeMS = System.currentTimeMillis() - entry.getStartTime();
Expand Down

0 comments on commit 03a4128

Please sign in to comment.