Order ExitCodeGenerators and return first non-zero exit code

See gh-30457
This commit is contained in:
dugenkui
2022-03-29 12:59:54 +08:00
committed by Andy Wilkinson
parent 245e602ae0
commit 6718b10fa9
3 changed files with 33 additions and 3 deletions

View File

@@ -354,7 +354,8 @@ 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.
[[features.spring-application.admin]]
=== Admin Features