From b86fbee7792b648929c05c8ea4c1b87e05210d85 Mon Sep 17 00:00:00 2001 From: Glenn Renfro Date: Mon, 17 Dec 2018 16:39:36 -0500 Subject: [PATCH] Update docs to discuss exit codes for failed annotated methods resolves #497 --- spring-cloud-task-docs/src/main/asciidoc/features.adoc | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/spring-cloud-task-docs/src/main/asciidoc/features.adoc b/spring-cloud-task-docs/src/main/asciidoc/features.adoc index 3944db58..f37789c5 100644 --- a/spring-cloud-task-docs/src/main/asciidoc/features.adoc +++ b/spring-cloud-task-docs/src/main/asciidoc/features.adoc @@ -314,6 +314,13 @@ https://docs.spring.io/spring-boot/docs/current/reference/htmlsingle/#boot-featu If so, it returns the exit code from the `ExitCodeGenerator`. Otherwise, `1` is returned. +In the case that an exception is thrown in an `onTaskStartup` method, the exit code for the application will be `1`. +If an exception is thrown in either a `onTaskEnd` or `onTaskFailed` +method, the exit code for the application will be the one established using the rules enumerated above. + +NOTE: In the case of an exception being thrown in a `onTaskStartup`, `onTaskEnd`, or `onTaskFailed` +you can not override the exit code for the application using `ExitCodeExceptionMapper`. + [[features-task-execution-listener-exit-messages]] @@ -370,6 +377,9 @@ application: spring-integration-jdbc +NOTE: The exit code for the application will be 1 if the task fails because this feature +is enabled and another task is running with the same task name. + === Disabling Spring Cloud Task Auto Configuration In cases where Spring Cloud Task should not be auto configured for an implementation, you can disable Task's auto configuration.