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 a HandlerAdapter 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 Details

    • handleError

      reactor.core.publisher.Mono<HandlerResult> handleError(ServerWebExchange exchange, Throwable ex)
      Handle the given exception, mapping it to a HandlerResult that can then be used to render an HTTP response.
      Parameters:
      exchange - the current exchange
      ex - the exception to handle
      Returns:
      a Mono that emits a HandlerResult or an error signal with the original exception if it remains not handled