Details
-
Improvement
-
Status: Closed
-
Major
-
Resolution: Fixed
-
1.1.6-SNAPSHOT, 1.2.3
-
None
-
None
Description
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)
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.