Module io.inverno.mod.http.server
Package io.inverno.mod.http.server
Interface ErrorExchange<A extends Throwable>
- Type Parameters:
A- the error type
- All Superinterfaces:
Exchange<ExchangeContext>
Represents a failing server exchange.
The HTTP server creates a failing exchange when an exception is thrown during
the normal processing of a server Exchange. They are handled in an
ErrorExchangeHandler that formats the actual response returned to the
client.
- Since:
- 1.0
- Author:
- Jeremy Kuhn
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptiongetError()Returns the error at the origin of the exchange.default <T extends Throwable>
ErrorExchange<T>Returns an error exchange consisting of the result of applying the given function to the error of the exchange.
-
Method Details
-
getError
A getError()Returns the error at the origin of the exchange.
- Returns:
- a throwable of type A
-
mapError
default <T extends Throwable> ErrorExchange<T> mapError(Function<? super A, ? extends T> errorMapper) Returns an error exchange consisting of the result of applying the given function to the error of the exchange.
- Type Parameters:
T- the error type of the new exchange- Parameters:
errorMapper- an error mapper- Returns:
- a new error exchange
-