@ -3410,26 +3410,6 @@ Support for `@ExceptionHandler` methods in Spring WebFlux is provided by the
@@ -3410,26 +3410,6 @@ Support for `@ExceptionHandler` methods in Spring WebFlux is provided by the
for more detail.
[[webflux-ann-rest-exceptions]]
==== REST API exceptions
[.small]#<<web.adoc#mvc-ann-rest-exceptions, Web MVC>>#
A common requirement for REST services is to include error details in the body of the
response. The Spring Framework does not automatically do so, because the representation
of error details in the response body is application-specific. However, a
`@RestController` can use `@ExceptionHandler` methods with a `ResponseEntity` return
value to set the status and the body of the response. Such methods can also be declared
in `@ControllerAdvice` classes to apply them globally.
Applications that implement global exception handling with error details in the response
@ -3700,6 +3698,7 @@ You should serve static resources with a `Cache-Control` and conditional respons
@@ -3700,6 +3698,7 @@ You should serve static resources with a `Cache-Control` and conditional respons
for optimal performance. See the section on configuring <<webflux-config-static-resources>>.
which provides handling for exceptions that Spring MVC raises and provides hooks to
customize the response body. To make use of this, create a subclass of
`ResponseEntityExceptionHandler`, annotate it with `@ControllerAdvice`, override the
necessary methods, and declare it as a Spring bean.
[[mvc-ann-controller-advice]]
=== Controller Advice
@ -4835,9 +4815,30 @@ Note that you can also set the default timeout value on a `DeferredResult`,
@@ -4835,9 +4815,30 @@ Note that you can also set the default timeout value on a `DeferredResult`,
a `ResponseBodyEmitter`, and an `SseEmitter`. For a `Callable`, you can use