Closed rahulkavale closed 6 years ago
Why don't you use unchecked (runtime) exceptions?
As I stated in the comment above, @ExceptionHandler
can handle runtime exceptions so I'm not sure why are you referring to @ExceptionHandler
feature.
Also, in the future please open an issue before creating a PR.
@stojsavljevic Cool, I had already made few changes and wanted to submit it back to community. Thanks for the feedback.
Change description Adds support to make the generated controller methods have
throws exception
in the signature in a configurable way. The behaviour can be controlled with a configuration parametercontrollerMethodThrowsException
which takes a boolean value representing if the exception clause is to be added to the controller method. Since the behaviour can be toggled from configuration with default value as false. Hence the change is backward compatible.Requirement for the feature To handle the exceptions from various places including the controller methods in a consistent way, Spring has
@ExceptionHandler
annotation. When using the@ExceptionHandler
, the logic to handle a particular exception can be done at a single place avoiding duplication. More details with example can be found at Spring documentation[x] Added Tests
[x] Updated documentation
[x] Backward compatible change