diff --git a/spring-cloud-dataflow-composed-task-runner/src/main/java/org/springframework/cloud/dataflow/composedtaskrunner/support/UnexpectedTaskExecutionException.java b/spring-cloud-dataflow-composed-task-runner/src/main/java/org/springframework/cloud/dataflow/composedtaskrunner/support/UnexpectedTaskExecutionException.java index 73a21e9ee2..763552ec6b 100644 --- a/spring-cloud-dataflow-composed-task-runner/src/main/java/org/springframework/cloud/dataflow/composedtaskrunner/support/UnexpectedTaskExecutionException.java +++ b/spring-cloud-dataflow-composed-task-runner/src/main/java/org/springframework/cloud/dataflow/composedtaskrunner/support/UnexpectedTaskExecutionException.java @@ -47,7 +47,7 @@ public class UnexpectedTaskExecutionException extends UnexpectedJobExecutionExce /** * The recorded exit code for the task. */ - private Integer exitCode; + private Integer exitCode = -1; /** * User defined name for the task. @@ -154,6 +154,12 @@ public long getExecutionId() { return this.executionId; } + /** + * Returns the exit code of the task. + * + * @return the exit code or -1 if the exit code couldn't be determined + */ + @Override public int getExitCode() { return this.exitCode; }