@Component
public class ErrorController
extends org.springframework.boot.autoconfigure.web.BasicErrorController
ErrorAttributes
for this application. All
errors without any specific ExceptionHandler
are handled by ${errorResponse(HttpServletRequest, HttpServletResponse)
} method.Constructor and Description |
---|
ErrorController(org.springframework.boot.autoconfigure.web.ErrorAttributes errAttrs,
org.springframework.boot.autoconfigure.web.ServerProperties serverProperties) |
Modifier and Type | Method and Description |
---|---|
org.springframework.http.ResponseEntity<ErrorResponse> |
errorResponse(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse res)
Handles all the errors and returns an
ErrorResponse . |
error, errorHtml, getErrorPath, getErrorProperties, isIncludeStackTrace
public ErrorController(org.springframework.boot.autoconfigure.web.ErrorAttributes errAttrs, org.springframework.boot.autoconfigure.web.ServerProperties serverProperties)
@RequestMapping(produces={"application/json","application/xml"}) @ResponseBody public org.springframework.http.ResponseEntity<ErrorResponse> errorResponse(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res)
ErrorResponse
.req
- http request which caused some error.res
- http response.Copyright © 2018 Walmart, Inc.. All rights reserved.