Top Description Methods
org.springframework.web.reactive

public Interface DispatchExceptionHandler

Known Direct Implementers
org.springframework.web.reactive.result.method.annotation.RequestMappingHandlerAdapter
Imports
reactor.core.publisher.Mono, org.springframework.web.server.ServerWebExchange

Contract to map a Throwable to a HandlerResult.

Supported by DispatcherHandler when used in the following ways:

Author
Rossen Stoyanchev
Since
6.0
See Also
HandlerAdapter, HandlerResult#setExceptionHandler(DispatchExceptionHandler)

Method Summary

Modifier and TypeMethod and Description
public Mono<HandlerResult>

Returns:

a Mono that emits a HandlerResult or an error signal with the original exception if it remains not handled
handleError
(ServerWebExchange
the current exchange
exchange
,
Throwable
the exception to handle
ex
)

Handle the given exception, mapping it to a HandlerResult that can then be used to render an HTTP response.

Method Detail

handleErrorback to summary
public 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:ServerWebExchange

the current exchange

ex:Throwable

the exception to handle

Returns:Mono<HandlerResult>

a Mono that emits a HandlerResult or an error signal with the original exception if it remains not handled