From 7779811d4e357f58eea7ed9a01147af59d068cab Mon Sep 17 00:00:00 2001 From: Tobias Soloschenko Date: Mon, 17 Jul 2023 10:06:42 +0200 Subject: [PATCH] fix: exit code if not present --- .../support/UnexpectedTaskExecutionException.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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; }