Skip to content

Commit 4d862b8

Browse files
vpavicrstoyanchev
authored andcommitted
Improve Javadoc for @ExceptionHandler
This commit adds `ProblemDetail` and `ErrorResponse` to the list of supported return types for `@ExceptionHandler` methods. Closes gh-34554 Signed-off-by: Vedran Pavic <[email protected]>
1 parent fa781c8 commit 4d862b8

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

spring-web/src/main/java/org/springframework/web/bind/annotation/ExceptionHandler.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,8 @@
8888
* (Servlet-only) to set response headers and content. The ResponseEntity body
8989
* will be converted and written to the response stream using
9090
* {@linkplain org.springframework.http.converter.HttpMessageConverter message converters}.
91+
* <li>A {@link org.springframework.http.ProblemDetail} or {@link org.springframework.web.ErrorResponse}
92+
* object to render an RFC 9457 error response with details in the body.
9193
* <li>{@code void} if the method handles the response itself (by
9294
* writing the response content directly, declaring an argument of type
9395
* {@link jakarta.servlet.ServletResponse} / {@link jakarta.servlet.http.HttpServletResponse}

0 commit comments

Comments
 (0)