public class HttpErrorAttributes
extends org.springframework.boot.web.servlet.error.DefaultErrorAttributes
ErrorAttributes
which adapts the handled HttpError to a Spring Boot's compatible error attributes
representation.HttpError,
HttpErrorAttributesAdapter,
BasicErrorController| Constructor and Description |
|---|
HttpErrorAttributes(WebErrorHandlers webErrorHandlers,
HttpErrorAttributesAdapter httpErrorAttributesAdapter)
Initializes the error attributes with required dependencies.
|
| Modifier and Type | Method and Description |
|---|---|
Map<String,Object> |
getErrorAttributes(org.springframework.web.context.request.WebRequest webRequest,
boolean includeStackTrace)
Extracts the thrown exception from the request attributes.
|
public HttpErrorAttributes(WebErrorHandlers webErrorHandlers, HttpErrorAttributesAdapter httpErrorAttributesAdapter)
webErrorHandlers - To handle exceptions.httpErrorAttributesAdapter - To adapt our representation of an error to Spring Boot's representation.NullPointerException - When one of the required parameters is null.public Map<String,Object> getErrorAttributes(org.springframework.web.context.request.WebRequest webRequest, boolean includeStackTrace)
webErrorHandlers and adapts the returned HttpError to a
Spring Boot compatible representation.getErrorAttributes in interface org.springframework.boot.web.servlet.error.ErrorAttributesgetErrorAttributes in class org.springframework.boot.web.servlet.error.DefaultErrorAttributeswebRequest - The current HTTP request.includeStackTrace - Whether or not to include the stack trace in the error attributes.Copyright © 2018. All rights reserved.