Polish "Order ExitCodeGenerators and return first non-zero exit code"

See gh-30457
This commit is contained in:
Andy Wilkinson
2022-04-07 16:31:19 +01:00
parent 6718b10fa9
commit 8727361221
4 changed files with 28 additions and 33 deletions

View File

@@ -354,8 +354,10 @@ include::code:MyApplication[]
Also, the `ExitCodeGenerator` interface may be implemented by exceptions.
When such an exception is encountered, Spring Boot returns the exit code provided by the implemented `getExitCode()` method.
If several `ExitCodeGenerator` are registered in a `ExitCodeGenerators`, they can be called in a specific order by using `org.springframework.core.annotation.Order` annotation or by implementing `org.springframework.core.Ordered`,
and `ExitCodeGenerators#getExitCode()` will return the first non-zero value.
If there is more than `ExitCodeGenerator`, the first non-zero exit code that is generated is used.
To control the order in which the generators are called, additionally implement the `org.springframework.core.Ordered` interface or use the `org.springframework.core.annotation.Order` annotation.
[[features.spring-application.admin]]
=== Admin Features