Interface StatusHandler
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
A handler that converts specific error
HttpStatus
s to a Throwable
to be propagated
downstream instead of the response.-
Method Summary
Modifier and TypeMethodDescriptionhandle
(ClientRequestContext ctx, HttpStatus status) Converts the specifiedHttpStatus
to aThrowable
.static StatusHandler
of
(HttpStatus status, Function<? super ClientRequestContext, ? extends Throwable> errorFunction) default StatusHandler
orElse
(StatusHandler other) Returns a newStatusHandler
that tries this handler first and then the specifiedother
handler if this handler does not handle the specifiedHttpStatus
.
-
Method Details
-
of
static StatusHandler of(HttpStatus status, Function<? super ClientRequestContext, ? extends Throwable> errorFunction) -
handle
Converts the specifiedHttpStatus
to aThrowable
. If theHttpStatus
is not handled by this handler, it must returnnull
. -
orElse
Returns a newStatusHandler
that tries this handler first and then the specifiedother
handler if this handler does not handle the specifiedHttpStatus
.
-