fun onError(predicate: (Throwable) -> Boolean, responseProvider: suspend (Throwable, ServerRequest) -> ServerResponse): Unit
Filters all exceptions that match the predicate by applying the given response provider function.
predicate
- the type of exception to filter
responseProvider
- a function that creates a response
Since
5.2
inline fun <reified E : Throwable> onError(noinline responseProvider: suspend (Throwable, ServerRequest) -> ServerResponse): Unit
Filters all exceptions that match the predicate by applying the given response provider function.
E
- the type of exception to filter
responseProvider
- a function that creates a response
Since
5.2