spring-framework
5.3.39

# onError

fun onError(predicate: (Throwable) -> Boolean, responseProvider: (Throwable, ServerRequest) -> Mono<ServerResponse>)
Content copied to clipboard

Filters all exceptions that match the predicate by applying the given response provider function.

#### Since

5.2

## Parameters

predicate

the type of exception to filter

responseProvider

a function that creates a response

inline fun <E : Throwable> onError(noinline responseProvider: (Throwable, ServerRequest) -> Mono<ServerResponse>)
Content copied to clipboard

Filters all exceptions that match the predicate by applying the given response provider function.

#### Since

5.2

## Parameters

E

the type of exception to filter

responseProvider

a function that creates a response