diff --git a/zanata-war/src/main/java/org/zanata/async/AsynchronousTaskExecutor.java b/zanata-war/src/main/java/org/zanata/async/AsynchronousTaskExecutor.java index 5f9a0f961f..00fb28a07d 100644 --- a/zanata-war/src/main/java/org/zanata/async/AsynchronousTaskExecutor.java +++ b/zanata-war/src/main/java/org/zanata/async/AsynchronousTaskExecutor.java @@ -32,6 +32,8 @@ import org.jboss.seam.security.Identity; import org.jboss.seam.security.RunAsOperation; +import lombok.extern.slf4j.Slf4j; + /** * This class executes a Runnable Process asynchronously. Do not use this class directly. * Use {@link org.zanata.async.TaskExecutor} instead as this is just a wrapper to make sure @@ -43,6 +45,7 @@ @Name("asynchronousTaskExecutor") @Scope(ScopeType.STATELESS) @AutoCreate +@Slf4j public class AsynchronousTaskExecutor { @Asynchronous @@ -63,6 +66,7 @@ public void execute() catch (Exception t) { task.getHandle().setException(t); + AsynchronousTaskExecutor.log.error("Exception when executing an asynchronous task.", t); } } diff --git a/zanata-war/src/main/java/org/zanata/rest/service/AsynchronousProcessResourceService.java b/zanata-war/src/main/java/org/zanata/rest/service/AsynchronousProcessResourceService.java index 29f0ff6f6a..168d5a4f25 100644 --- a/zanata-war/src/main/java/org/zanata/rest/service/AsynchronousProcessResourceService.java +++ b/zanata-war/src/main/java/org/zanata/rest/service/AsynchronousProcessResourceService.java @@ -252,11 +252,13 @@ public ProcessStatus getProcessStatus(@PathParam("processId") String processId) catch (InterruptedException e) { // The process was forcefully cancelled + status.setStatusCode(ProcessStatusCode.Failed); status.setMessages(Lists.newArrayList(e.getMessage())); } catch (ExecutionException e) { // Exception thrown while running the task + status.setStatusCode(ProcessStatusCode.Failed); status.setMessages(Lists.newArrayList(e.getCause().getMessage())); }