public class DefaultErrorAttributes extends java.lang.Object implements ErrorAttributes
ErrorAttributes
. Provides the following attributes
when possible:
ObjectError
s from a BindingResult
exception (if
configured)ErrorAttributes
Constructor and Description |
---|
DefaultErrorAttributes()
Create a new
DefaultErrorAttributes instance. |
DefaultErrorAttributes(boolean includeException)
Deprecated.
since 2.3.0 in favor of
ErrorAttributeOptions.including(Include...) |
Modifier and Type | Method and Description |
---|---|
java.lang.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. |
java.util.Map<java.lang.String,java.lang.Object> |
getErrorAttributes(org.springframework.web.reactive.function.server.ServerRequest request,
boolean includeStackTrace)
Deprecated.
|
java.util.Map<java.lang.String,java.lang.Object> |
getErrorAttributes(org.springframework.web.reactive.function.server.ServerRequest request,
ErrorAttributeOptions options)
Return a
Map of the error attributes. |
void |
storeErrorInformation(java.lang.Throwable error,
org.springframework.web.server.ServerWebExchange exchange)
Store the given error information in the current
ServerWebExchange . |
public DefaultErrorAttributes()
DefaultErrorAttributes
instance.@Deprecated public DefaultErrorAttributes(boolean includeException)
ErrorAttributeOptions.including(Include...)
DefaultErrorAttributes
instance.includeException
- whether to include the "exception" attributepublic java.util.Map<java.lang.String,java.lang.Object> getErrorAttributes(org.springframework.web.reactive.function.server.ServerRequest request, ErrorAttributeOptions options)
ErrorAttributes
Map
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 ErrorAttributes
request
- the source requestoptions
- options for error attribute contents@Deprecated public java.util.Map<java.lang.String,java.lang.Object> getErrorAttributes(org.springframework.web.reactive.function.server.ServerRequest request, boolean includeStackTrace)
ErrorAttributes
Map
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 ErrorAttributes
request
- the source requestincludeStackTrace
- if stack trace attribute should be includedpublic java.lang.Throwable getError(org.springframework.web.reactive.function.server.ServerRequest request)
ErrorAttributes
null
if the error cannot be
extracted.getError
in interface ErrorAttributes
request
- the source ServerRequestException
that caused the error or null
public void storeErrorInformation(java.lang.Throwable error, org.springframework.web.server.ServerWebExchange exchange)
ErrorAttributes
ServerWebExchange
.storeErrorInformation
in interface ErrorAttributes
error
- the Exception
that caused the errorexchange
- the source exchange