How should a global exception handler work in a web application?

In a web application on a global enterprise intranet, what should it display? What are some of the best practices or things that some of you have learned over the years?

I am thinking of putting a textbox and a submit button on the error page, which allows the user to automatically submit a reference ticket if they need to ... It will make sure to log the error ... what else?

0


a source to share


5 answers


If you are using .Net get Elmah . (Error loggers and handlers).

It opens up and is very easy to use.

Typically, any errors such as exceptions should be automatically logged and submitted to the bug tracking system. Potentially, they should also be emailed to people on call. In other words, don't depend on what users tell you that there is a problem that goes hand in hand before they know about it.



If you want, a button on each of your web pages that allows users to submit a ticket is a good idea. Just keep it very simple (one box is good) and let them submit for whatever reason. This information should be delivered to someone who can make a decision about it as soon as possible, whether by email or via a help ticket.

You can get a lot of good reviews for things you didn't even think about.

+3


a source


Take a look at ELMAH . It may very well do whatever you might want pretty much out of the box :)



+2


a source


We usually log all exceptions. An ideal application should not end up in a state where the user sees an error page, so any exception that is unhandled should be considered a potential error.

I have had some success using hoptoad to log exceptions - it groups related exceptions and gives you the count of each group (preventing duplicate notifications). We also receive emails for every exception, which includes the stack trace and the exception.

You can't wait for a user to tell you there is a problem - you need to know more about your system than they do, and handle errors when they appear, not when someone is complaining about them.

+1


a source


Depends on the site, but many sites just log the error and redirect to the home page (or the error page if you like).

For a public site, it usually doesn't make sense to redirect an error page (IMO) as most users don't know what to do with it. For an intranet site, though that might make more sense.

+1


a source


Configure your registrar to automatically send email messages.

0


a source







All Articles