This repository has been archived by the owner on Jan 30, 2020. It is now read-only.
Exit application if environment verification failed #75
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description of the Change
This change performs exit from Java process if AbstractService.verifyEnvironment() throws an exception during application start up.
Benefits
Currently, if method throws an exception, process stays alive, even though application won't function properly. This change makes sure, that if application's environment isn't valid (or something went wrong while trying to verify it), the program will terminate with the proper error logged. (Before, even though the message was logged, application continued to work in a broken state and could potentially confuse monitoring systems)
Possible Drawbacks
None, unless the semantic of AbstractService.verifyEnvironment() isn't supposed to be treated like that and it's ok to fail and not terminate the application (or if someone has been using it like that already, in which case after this fix application won't start unless no exception is thrown)