WebFluxErrorStrategy

The one mapping from a failure to what an HTTP client sees.

Every error Wow's routes report goes through it: the error response of a JSON route (toServerResponse), a failure outside the routes (writeToExchange), and, since 9.3.0, the error event of an SSE stream and the error of a batch result (toErrorInfo), so one failure gets the same error code and message on every route.

Inheritors

Functions

Link copied to clipboard
open fun toErrorInfo(throwable: Throwable): ErrorInfo

The error code and message reported for throwable where the response has no status of its own: an SSE error event, the error of a batch result. A failure the strategy does not classify is InternalServerError with a generic message, never the exception's own.

Link copied to clipboard
abstract fun toServerResponse(request: ServerRequest, throwable: Throwable): Mono<ServerResponse>
Link copied to clipboard
abstract fun writeToExchange(exchange: ServerWebExchange, throwable: Throwable): Mono<Void>