Uploaded image for project: 'MyFaces Core'
  1. MyFaces Core
  2. MYFACES-1888

catch Throwable errors when using ErrorPageWriter (myfaces error handling)

    XMLWordPrintableJSON

Details

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

      { 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.

      Attachments

        Activity

          People

            lu4242 Leonardo Uribe
            lu4242 Leonardo Uribe
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: