2 Replies Latest reply on Oct 21, 2009 8:15 AM by Pieter Porre

    abstract error handling

    John Who Newbie

      Hi,

      I'm having a general question about the error handling.
      I have to deal with gui-exceptions (f.ex. during validation) but also with buisniss and/or server exceptions (f.ex. during processing some business logic or getting a hibernate exception because of a missaranged mapping)

      Displaying and handling the gui exception is not the problem. But how to handle the other ones?

      What I'm thinking of is a solution which catches all the business-exceptions and handle it (formatting for the gui, etc.). So I can throw an NullPointerExcpetion in my service method (no validation error) and feel confident that this exception gets catched in a central class and becomes handled.

      Right now I'm trying with an abstract managed bean which covers all my managed beans. But I don't know what kind of method I have to implement to catch every exceptions...
      Another solution I was thinking of is to implement some listener.

      I read that (in myfaces) you can declare an own ErrorHandler by adding the following lines in the deployment descriptor:

      <context-param>
      <param-name>org.apache.myfaces.ERROR_HANDLER</param-name>
      <param-value>my.project.ErrorHandler</param-value>
      </context-param>
      


      Is there a similar solution for richfaces? And which method do I have to implement in this class to catch the exceptions?

      I'm running out of ideas. So thanks in advance for any kind of help!!