Interface ErrorAttributes
- All Known Implementing Classes:
DefaultErrorAttributes
public interface ErrorAttributes
Provides access to error attributes which can be logged or presented to the user.
- Since:
- 4.0.0
- Author:
- Phillip Webb, Scott Frederick
- See Also:
-
Method Summary
Modifier and TypeMethodDescription@Nullable ThrowablegetError(WebRequest webRequest) Return the underlying cause of the error ornullif the error cannot be extracted.getErrorAttributes(WebRequest webRequest, ErrorAttributeOptions options) Returns aMapof the error attributes.
-
Method Details
-
getErrorAttributes
default Map<String, @Nullable Object> getErrorAttributes(WebRequest webRequest, ErrorAttributeOptions options) Returns aMapof the error attributes. The map can be used as the model of an error pageModelAndView, or returned as a@ResponseBody.- Parameters:
webRequest- the source requestoptions- options for error attribute contents- Returns:
- a map of error attributes
-
getError
Return the underlying cause of the error ornullif the error cannot be extracted.- Parameters:
webRequest- the source request- Returns:
- the
Exceptionthat caused the error ornull
-