public interface ErrorAttributes
DefaultErrorAttributes
Modifier and Type | Field and Description |
---|---|
static String |
ERROR_ATTRIBUTE
Name of the
request attribute holding the
error resolved by the ErrorAttributes implementation. |
Modifier and Type | Method and Description |
---|---|
Throwable |
getError(ServerRequest request)
Return the underlying cause of the error or
null if the error cannot be
extracted. |
default Map<String,Object> |
getErrorAttributes(ServerRequest request,
ErrorAttributeOptions options)
Return a
Map of the error attributes. |
void |
storeErrorInformation(Throwable error,
ServerWebExchange exchange)
Store the given error information in the current
ServerWebExchange . |
static final String ERROR_ATTRIBUTE
request attribute
holding the
error resolved by the ErrorAttributes
implementation.default Map<String,Object> getErrorAttributes(ServerRequest request, ErrorAttributeOptions options)
Map
of the error attributes. The map can be used as the model of
an error page, or returned as a ServerResponse
body.request
- the source requestoptions
- options for error attribute contentsThrowable getError(ServerRequest request)
null
if the error cannot be
extracted.request
- the source ServerRequestException
that caused the error or null
void storeErrorInformation(Throwable error, ServerWebExchange exchange)
ServerWebExchange
.error
- the Exception
that caused the errorexchange
- the source exchange