2 Replies Latest reply on Oct 5, 2008 9:20 PM by ahus1

    Advanced error handling ideas

    ahus1

      We at our company are exploring advanced error handling ideas. The basic error handling to end the conversation and to display a standard page can be quite annoying for the user.


      First I like to share and discuss ideas, and I'm happy to share the code that is already available for this.


      Do you think anything should become standard in SEAM? Or should I document it in the FAQ?


      The ideas (first matching rule completes the error handling):


      (1) when the error occurs during a POST request, return to the last known view in the conversation and display the error message


      (2) when the error occurs in a pageflow, reposition the pageflow at the last known node and display the error message


      (3) when there is a nested conversation, end the current conversation and display the message on the last known view of the parent conversation


      (4) if there is no other remedy, use a default error page


      The pages.xml would look like this:


       <exception class="java.lang.Exception">
        <redirect
         view-id="#{exceptionHandler.getViewId('/sportal/error.jspx')}">
         <message severity="error">
          #{messages[exceptionHandler.getMessage(org.jboss.seam.handledException)]}
         </message>
        </redirect>
       </exception>
      



      What do you think about the ideas?


      Alexander.

        • 1. Re: Advanced error handling ideas
          admin.admin.email.tld

          when you say error handling do you mean exception handling or validation error handling via Hibernate Validators?


          I'm thinking you mean exception handling.  For example, a DB exception (e.g., transaction failed for some reason), user gets re-directed to generic error.xhtml.  and presumably must re-start conversation/use case.


          So you're saying in this case, the LRC is demoted to temporary conversation.  Why does that demotion need to happen?  Why can't user have a link to go back to previous page and re-exec the use case?

          • 2. Re: Advanced error handling ideas
            ahus1

            Sool,


            how would you like to redirect the use to the previous page? Javascript? Or is there any other way to do this?


            Redirecting her/him to the original page (where they are able to change i.e. their inputs) and displaying the error message at the same time sounds like a good idea to me.


            I posted my code on another thread, the exception handler posted there works with any exception.


            Error Handling w/ JPDL


            Alexander.