3 Replies Latest reply on Apr 10, 2008 12:38 AM by Sander S

    Error handling

    Nicklas Karlsson Master

      What (if any) have you done to provide the user with more specific information on what went wrong when running across exceptions (more detailed than splitting them by type at pages.xml)?

      One theory I had was to have a @ExceptionHandled that would extract information about the method and rethrow a custom exception. Other annotated methods would then add to the exception message stack to provide an overview what the execution path had been

      Another theory was just to run everyting through to a common exception handle that would extract the same information from the final stack trace

      In both cases the method descrption would be a @Decscription annotation or a resource bundle with classname.methodname as key.

      This would enabled error messages like "There was en error saving the user. This was due to an error in the database. The error was 'ORA-00000 horror and terror'" with annotations or resource bundle entries.

      Should the user even be bothered with such information?

        • 1. Re: Error handling
          di pas Newbie

          Hi Nicklas

          Look at the Seam Wicki message.xhtml there you can find an example with stack-trace.

          • 2. Re: Error handling
            Sander S Newbie

            Nicklas Karlsson wrote on Apr 09, 2008 01:36 PM:

            Should the user even be bothered with such information?

            User don't care, just place a message that the message/error has been sent to the administrator (or something that makes them think you'll handle it) Good logging (or logmails) is they key.

            Showing detailed errors to users is also a security leak

            • 3. Re: Error handling
              Sander S Newbie

              What user want to know is what they can do next, so if a transaction fails because a 3rd party service is down place a message to try again in a few minutes, try a new transaction or well you get the picture. Just ask your mother whats she need to know not to panic, if mine sees error on screen she gets confused.