Search in sources :

Example 1 with HasAdditionalAttributes

use of com.netflix.spinnaker.kork.web.exceptions.HasAdditionalAttributes in project kork by spinnaker.

the class GenericErrorController method error.

@RequestMapping(value = "/error")
public Map error(@RequestParam(value = "trace", defaultValue = "false") Boolean includeStackTrace, HttpServletRequest httpServletRequest) {
    ServletRequestAttributes servletRequestAttributes = new ServletRequestAttributes(httpServletRequest);
    Map<String, Object> attributes = errorAttributes.getErrorAttributes(servletRequestAttributes, includeStackTrace);
    Throwable exception = errorAttributes.getError(servletRequestAttributes);
    if (exception != null && exception instanceof HasAdditionalAttributes) {
        attributes.putAll(((HasAdditionalAttributes) exception).getAdditionalAttributes());
    }
    return attributes;
}
Also used : HasAdditionalAttributes(com.netflix.spinnaker.kork.web.exceptions.HasAdditionalAttributes) ServletRequestAttributes(org.springframework.web.context.request.ServletRequestAttributes) RequestMapping(org.springframework.web.bind.annotation.RequestMapping)

Aggregations

HasAdditionalAttributes (com.netflix.spinnaker.kork.web.exceptions.HasAdditionalAttributes)1 RequestMapping (org.springframework.web.bind.annotation.RequestMapping)1 ServletRequestAttributes (org.springframework.web.context.request.ServletRequestAttributes)1