Skip to content

v0.2.53..v0.2.54 changeset JobRunnable.java

Garret Voltz edited this page Mar 31, 2020 · 1 revision
diff --git a/hoot-services/src/main/java/hoot/services/job/JobRunnable.java b/hoot-services/src/main/java/hoot/services/job/JobRunnable.java
index ad01b6b..a3cf12b 100644
--- a/hoot-services/src/main/java/hoot/services/job/JobRunnable.java
+++ b/hoot-services/src/main/java/hoot/services/job/JobRunnable.java
@@ -26,6 +26,8 @@
  */
 package hoot.services.job;
 
+import javax.ws.rs.WebApplicationException;
+
 import org.apache.commons.lang3.exception.ExceptionUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -103,9 +105,9 @@ class JobRunnable implements Runnable {
                 DbUtils.checkConflicted(job.getJobId(), parentId);
             }
         }
-        catch (Exception e) {
-            jobStatusManager.setFailed(job.getJobId(),
-                    "Job with ID = " + job.getJobId() + " failed with the following error --> " + ExceptionUtils.getStackTrace(e));
+        catch (WebApplicationException e) {
+            logger.error("Job with ID = " + job.getJobId() + " failed with the following error --> " + ExceptionUtils.getStackTrace(e));
+            jobStatusManager.setFailed(job.getJobId(), e.getResponse().getEntity().toString());
             throw e;
         }
 
Clone this wiki locally