public synchronized ActionForward handleException ( Throwable ex , ActionMapping mapping , ActionForm form , HttpServletRequest request , HttpServletResponse response ) throws IOException , ServletException { PerRequestState prevState = setPerRequestState ( new PerRequestState ( request , response , mapping ) ) ; try { ExceptionsHandler eh = Handlers . get ( getServletContext ( ) ) . getExceptionsHandler ( ) ; FlowControllerHandlerContext context = getHandlerContext ( ) ; // First, put the exception into the request (or other applicable context). Throwable unwrapped = eh . unwrapException ( context , ex ) ; eh . exposeException ( context , unwrapped , mapping ) ; return eh . handleException ( context , unwrapped , mapping , form ) ; } finally { setPerRequestState ( prevState ) ; } }
Handle the given exception - invoke user code if appropriate and return a destination URI .