-
Notifications
You must be signed in to change notification settings - Fork 3k
Add exception handler description in Spring web docs #5391
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
Add exception handler description in Spring web docs #5391
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot!
Can you please squash into a single commit? Best not to have superfluous commits in the history |
bd20ac8
to
4e7fab2
Compare
@geoand should it be backported? |
@cescoffier yes yes! |
I've restarted the failing tests as they look unrelated. |
|
||
* `org.springframework.http.ResponseEntity` | ||
* `java.util.Map` | ||
* `void`, but in Quarkus, it must be combined with a `@ResponseStatus` annotation on the method to send an status error to HTTP response. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@geoand I think this is not true anymore?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Correct, this restriction has been lifted
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I notice the void
item has been removed. If the void
return type is supported, I think we need a void
in the list. I know the issue is fixed.
|
||
=== Exception handler method parameter types | ||
|
||
The following parameter types are supportted, in arbitrary order: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The following parameter types are supportted, in arbitrary order: | |
The following parameter types are supported, in arbitrary order: |
|
||
The following parameter types are supportted, in arbitrary order: | ||
|
||
* An exception argument: declared as a general Exception or as a more specific exception. This also serves as a mapping hint if the annotation itself does not narrow the exception types through its `value()`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* An exception argument: declared as a general Exception or as a more specific exception. This also serves as a mapping hint if the annotation itself does not narrow the exception types through its `value()`. | |
* An exception argument: declared as a general `Exception` or as a more specific exception. This also serves as a mapping hint if the annotation itself does not narrow the exception types through its `value()`. |
The following parameter types are supportted, in arbitrary order: | ||
|
||
* An exception argument: declared as a general Exception or as a more specific exception. This also serves as a mapping hint if the annotation itself does not narrow the exception types through its `value()`. | ||
* Request and/or response objects (typically from the Servlet API). You may choose any specific request/response type, e.g. `ServletRequest` / `HttpServletRequest`. To use Servlet API, you should add `qarkus-undertow` dependency. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* Request and/or response objects (typically from the Servlet API). You may choose any specific request/response type, e.g. `ServletRequest` / `HttpServletRequest`. To use Servlet API, you should add `qarkus-undertow` dependency. | |
* Request and/or response objects (typically from the Servlet API). You may choose any specific request/response type, e.g. `ServletRequest` / `HttpServletRequest`. To use Servlet API, you should add `quarkus-undertow` dependency. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not ready yet. I added a couple of comments and questions.
4e7fab2
to
9b5a8a9
Compare
@gsmet I force pushed to the PR to address the issues you mentioned |
I checked it manually to avoid having to wait for CI. Will backport now. |
Thanks @gsmet once again!! |
Mentioned in issue #4042, added sections for exception handlers. This PR should be clean finally when #4042 and #5374 are resolved.