Skip to content

Commit

Permalink
Merge pull request #76 from OndroMih/ondromih-throw-exception-not-onl…
Browse files Browse the repository at this point in the history
…y-pass

Throw exception in managed task so that it has to be handled or logged.
  • Loading branch information
arjantijms committed Mar 4, 2024
2 parents 00c4563 + f78a7c8 commit c1a6f9c
Showing 1 changed file with 2 additions and 1 deletion.
Expand Up @@ -245,13 +245,14 @@ public String getTaskIdentityName() {
private void abort() {
// Context handle not in valid state, throws AbortedException and
// do not run the task
AbortedException ex = new AbortedException(contextSetupException.getMessage());
AbortedException ex = new AbortedException(contextSetupException.getMessage(), contextSetupException);
setException(ex);
if (taskListener != null) {
// notify listener. No need to set context here as it wouldn't work
// anyway
taskListener.taskAborted(this, executor.getExecutorForTaskListener(), task, ex);
}
throw new RuntimeException(ex);
}

}

0 comments on commit c1a6f9c

Please sign in to comment.