Package ubic.gemma.web.controller.util
Class UnhandledExceptionResolver
java.lang.Object
ubic.gemma.web.controller.util.UnhandledExceptionResolver
- All Implemented Interfaces:
org.springframework.web.servlet.HandlerExceptionResolver
public class UnhandledExceptionResolver
extends Object
implements org.springframework.web.servlet.HandlerExceptionResolver
Resolver used when no other resolver can intervene.
This is essentially delegating work to a SimpleMappingExceptionResolver
with the added benefit that the
exception can be logged beforehand with a given error category.
- Author:
- poirigui
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.web.servlet.ModelAndView
resolveException
(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, Object handler, Exception ex) void
setErrorCategory
(String loggerName) Set the name of the logger to use for reporting unhandled exceptions.void
setErrorView
(String errorView) Set the view to use for reporting unhandled exception.void
setStatusCode
(int statusCode) Set the status code to use for reporting unhandled exception.
-
Constructor Details
-
UnhandledExceptionResolver
public UnhandledExceptionResolver()
-
-
Method Details
-
resolveException
public org.springframework.web.servlet.ModelAndView resolveException(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, Object handler, Exception ex) - Specified by:
resolveException
in interfaceorg.springframework.web.servlet.HandlerExceptionResolver
-
setErrorCategory
Set the name of the logger to use for reporting unhandled exceptions.By default, no logging is done.
- See Also:
-
setStatusCode
public void setStatusCode(int statusCode) Set the status code to use for reporting unhandled exception.Defaults to 500.
- See Also:
-
setErrorView
Set the view to use for reporting unhandled exception.Default is none.
- See Also:
-