public class DefaultErrorAttributes extends Object implements ErrorAttributes
ErrorAttributes. Provides the following attributes
when possible:
ObjectErrors from a BindingResult exception
ErrorAttributes| Constructor and Description |
|---|
DefaultErrorAttributes()
Create a new
DefaultErrorAttributes instance that does not include the
"exception" attribute. |
DefaultErrorAttributes(boolean includeException)
Create a new
DefaultErrorAttributes instance. |
| Modifier and Type | Method and Description |
|---|---|
Throwable |
getError(org.springframework.web.reactive.function.server.ServerRequest request)
Return the underlying cause of the error or
null if the error cannot be
extracted. |
Map<String,Object> |
getErrorAttributes(org.springframework.web.reactive.function.server.ServerRequest request,
boolean includeStackTrace)
Return a
Map of the error attributes. |
void |
storeErrorInformation(Throwable error,
org.springframework.web.server.ServerWebExchange exchange)
Store the given error information in the current
ServerWebExchange. |
public DefaultErrorAttributes()
DefaultErrorAttributes instance that does not include the
"exception" attribute.public DefaultErrorAttributes(boolean includeException)
DefaultErrorAttributes instance.includeException - whether to include the "exception" attributepublic Map<String,Object> getErrorAttributes(org.springframework.web.reactive.function.server.ServerRequest request, boolean includeStackTrace)
ErrorAttributesMap of the error attributes. The map can be used as the model of
an error page, or returned as a ServerResponse body.getErrorAttributes in interface ErrorAttributesrequest - the source requestincludeStackTrace - if stack trace elements should be includedpublic Throwable getError(org.springframework.web.reactive.function.server.ServerRequest request)
ErrorAttributesnull if the error cannot be
extracted.getError in interface ErrorAttributesrequest - the source ServerRequestException that caused the error or nullpublic void storeErrorInformation(Throwable error, org.springframework.web.server.ServerWebExchange exchange)
ErrorAttributesServerWebExchange.storeErrorInformation in interface ErrorAttributeserror - the Exception that caused the errorexchange - the source exchangeCopyright © 2019 Pivotal Software, Inc.. All rights reserved.