use of ru.javawebinar.topjava.AuthorizedUser in project topjava10 by JavaWebinar.
the class GlobalControllerExceptionHandler method defaultErrorHandler.
@ExceptionHandler(Exception.class)
public ModelAndView defaultErrorHandler(HttpServletRequest req, Exception e) throws Exception {
LOG.error("Exception at request " + req.getRequestURL(), e);
ModelAndView mav = new ModelAndView("exception/exception");
mav.addObject("exception", e);
// Interceptor is not invoked, put userTo
AuthorizedUser authorizedUser = AuthorizedUser.safeGet();
if (authorizedUser != null) {
mav.addObject("userTo", authorizedUser.getUserTo());
}
return mav;
}
Aggregations