[ https://issues.apache.org/jira/browse/MYFACES-1888?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Leonardo Uribe updated MYFACES-1888: ------------------------------------ Status: Patch Available (was: Open) > catch Throwable errors when using ErrorPageWriter (myfaces error handling) > -------------------------------------------------------------------------- > > Key: MYFACES-1888 > URL: https://issues.apache.org/jira/browse/MYFACES-1888 > Project: MyFaces Core > Issue Type: Improvement > Affects Versions: 1.1.6-SNAPSHOT, 1.2.3 > Reporter: Leonardo Uribe > Assignee: Leonardo Uribe > Attachments: patchHandleErrorListUpdatePhase11.patch > > > One possible enhancement to the myfaces error handling capability is catch > Throwable errors when using myfaces error handling. > This should be done taking into account what the spec says about it: > - Call the execute() method of the saved Lifecycle instance, passing the > FacesContext instance for this request as a parameter. If the execute() > method throws a FacesException, re-throw it as a ServletException with > the FacesException as the root cause. > Call the render() method of the saved Lifecycle instance, passing the > FacesContext instance for this request as a parameter. If the render() method > throws a FacesException, re-throw > The idea is catch and rethrow non Exception classes like errors (extends from > Throwable or Error classes directly). If Myfaces error handling is used use > it to show the error page with the info, taking into account that not all > info could be available. > The idea is do this on FacesServlet: > try { > _lifecycle.execute(facesContext); > if (!handleQueuedExceptions(facesContext)) > { > _lifecycle.render(facesContext); > } > } > catch (Exception e) > { > handleLifecycleException(facesContext, e); > } > catch (Throwable e) > { > //Handle Error and Throwable error cases (out-of-memory-errors, > ....). > handleLifecycleThrowable(facesContext, e); > } > finally > { > facesContext.release(); > } > Please note that any change should not break old functionality. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.