Package org.springframework.web.reactive
Interface DispatchExceptionHandler
- All Known Implementing Classes:
RequestMappingHandlerAdapter
public interface DispatchExceptionHandler
Contract to map a
Throwable
to a HandlerResult
.
Supported by DispatcherHandler
when used in the following ways:
- Set on a
HandlerResult
, allowing aHandlerAdapter
to apply its exception handling to deferred exceptions from asynchronous return values, and to response rendering. - Implemented by a
HandlerAdapter
in order to handle exceptions that occur before a request is mapped to a handler, or for unhandled errors from a handler..
- Since:
- 6.0
- Author:
- Rossen Stoyanchev
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionreactor.core.publisher.Mono<HandlerResult>
handleError
(ServerWebExchange exchange, Throwable ex) Handle the given exception, mapping it to aHandlerResult
that can then be used to render an HTTP response.
-
Method Details
-
handleError
Handle the given exception, mapping it to aHandlerResult
that can then be used to render an HTTP response.- Parameters:
exchange
- the current exchangeex
- the exception to handle- Returns:
- a
Mono
that emits aHandlerResult
or an error signal with the original exception if it remains not handled
-