@Bean @ConditionalOnMissingBean(value = ErrorAttributes.class, search = SearchStrategy.CURRENT) public ExtendedErrorAttributes errorAttributes() { return new ExtendedErrorAttributes(); }
@Override public Throwable getError(final RequestAttributes requestAttributes) { final Throwable found = getAttribute(requestAttributes, ERROR_ATTRIBUTE); return found != null ? found : getAttribute(requestAttributes, "javax.servlet.error.exception"); }
@Override public Map<String, Object> getErrorAttributes( // final RequestAttributes requestAttributes, // final boolean includeStackTrace // ) { final Throwable error = getError(requestAttributes); final ResolvedError resolved = ResolvedErrorException.isResolvedError(error) ? // ((ResolvedErrorException) error).getError() : // this.resolver.resolve(requestAttributes, error); return resolved != null ? resolved.toErrorAttributes() : ImmutableMap.of(); }
@Override public ModelAndView resolveException( // final HttpServletRequest request, // final HttpServletResponse response, // final Object handler, // final Exception ex // ) { final ResolvedError resolved = this.resolver.resolve(request, ex); this.storeErrorAttributes(request, resolved != null ? new ResolvedErrorException(resolved) : ex); return null; }
@Override public Map<String, Object> getErrorAttributes( // final RequestAttributes requestAttributes, // final boolean includeStackTrace // ) { final Throwable error = getError(requestAttributes); final ResolvedError resolved = ResolvedErrorException.isResolvedError(error) ? // ((ResolvedErrorException) error).getError() : // this.resolver.resolve(requestAttributes, error); return resolved != null ? resolved.toErrorAttributes() : ImmutableMap.of(); }
@Override public ModelAndView resolveException( // final HttpServletRequest request, // final HttpServletResponse response, // final Object handler, // final Exception ex // ) { final ResolvedError resolved = this.resolver.resolve(request, ex); this.storeErrorAttributes(request, resolved != null ? new ResolvedErrorException(resolved) : ex); return null; }
@Override public Throwable getError(final RequestAttributes requestAttributes) { final Throwable found = getAttribute(requestAttributes, ERROR_ATTRIBUTE); return found != null ? found : getAttribute(requestAttributes, "javax.servlet.error.exception"); }
@Bean @ConditionalOnMissingBean(value = ErrorAttributes.class, search = SearchStrategy.CURRENT) public ExtendedErrorAttributes errorAttributes() { return new ExtendedErrorAttributes(); }