use of com.navercorp.pinpoint.web.view.error.InternalServerError in project pinpoint by naver.
the class ControllerExceptionHandler method defaultErrorHandler.
@ExceptionHandler(value = Exception.class)
public ModelAndView defaultErrorHandler(HttpServletRequest request, Exception exception) throws Exception {
Objects.requireNonNull(request, "request");
Objects.requireNonNull(exception, "exception");
InternalServerError.RequestInfo requestInfo = createRequestResource(request);
logger.warn("Failed to execute controller methods. message:{}, request:{}.", exception.getMessage(), requestInfo, exception);
ModelAndView mav = new ModelAndView();
InternalServerError error = createExceptionResource(requestInfo, exception);
mav.addObject("exception", error);
mav.setViewName(DEFAULT_ERROR_VIEW);
mav.setStatus(HttpStatus.INTERNAL_SERVER_ERROR);
return mav;
}
Aggregations