public interface ErrorAttributes
DefaultErrorAttributes
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
ERROR_ATTRIBUTE
Name of the
request attribute holding the error resolved by the ErrorAttributes
implementation. |
Modifier and Type | Method and Description |
---|---|
java.lang.Throwable |
getError(org.springframework.web.context.request.WebRequest webRequest)
Return the underlying cause of the error or
null if the error cannot be
extracted. |
default java.util.Map<java.lang.String,java.lang.Object> |
getErrorAttributes(org.springframework.web.context.request.WebRequest webRequest,
ErrorAttributeOptions options)
Returns a
Map of the error attributes. |
static final java.lang.String ERROR_ATTRIBUTE
request attribute
holding the error resolved by the ErrorAttributes
implementation.default java.util.Map<java.lang.String,java.lang.Object> getErrorAttributes(org.springframework.web.context.request.WebRequest webRequest, ErrorAttributeOptions options)
Map
of the error attributes. The map can be used as the model of
an error page ModelAndView
, or returned as a
@ResponseBody
.webRequest
- the source requestoptions
- options for error attribute contentsjava.lang.Throwable getError(org.springframework.web.context.request.WebRequest webRequest)
null
if the error cannot be
extracted.webRequest
- the source requestException
that caused the error or null