Skip to content

Implement more flexible error handling #553

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 14, 2022

Conversation

jvalkeal
Copy link
Contributor

  • Add exception handling around new interface CommandExceptionResolver which allows to define a chain of resolvers to process errors before exception is bubbled up to result handlers.
  • Will be foundation to add more sophisticated error handling features compared to what spring itself have for rest layer.
  • Resolver returns CommandHandlingResult holder which further can be used to make a choice what to print into console and if spesific exit code should be used in non-interactive mode.
  • Exception handling can be defined globally and per command giving a change for user to customise i.e. error thrown by parser.
  • CommandParserExceptionResolver replaces CommandParserExceptionsExceptionResultHandler and provides more meaninful message for missing options.
  • Fixes More descriptive error message when required option is not present #503

- Add exception handling around new interface CommandExceptionResolver
  which allows to define a chain of resolvers to process errors before
  exception is bubbled up to result handlers.
- Will be foundation to add more sophisticated error handling features
  compared to what spring itself have for rest layer.
- Resolver returns CommandHandlingResult holder which further can be
  used to make a choice what to print into console and if spesific exit
  code should be used in non-interactive mode.
- Exception handling can be defined globally and per command giving
  a change for user to customise i.e. error thrown by parser.
- CommandParserExceptionResolver replaces CommandParserExceptionsExceptionResultHandler
  and provides more meaninful message for missing options.
- Fixes spring-projects#503
@jvalkeal jvalkeal merged commit 4c48017 into spring-projects:main Oct 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

More descriptive error message when required option is not present
1 participant