New MSDN article: Rich Custom Error Handling

There are a lot of bytes online about handling exceptions in ASP.NET. This article presents a solution you can have running in an hour or two. From the introduction:

“An ideal error page maintains the look and feel of the site, offers the ability to provide detailed errors to internal developers — identified by IP address — and at the same time offers no detail to end users. Instead, it gets them back to what they were seeking — easily and without confusion. The site administrator should be able to review errors encountered either by e-mail or in the server logs, and optionally be able to receive feedback from users who run into trouble. Is this the stuff of dreams? No more.”

The downloadable source code found in the article produces this sort of screen when hit by the developer (i.e. from an IP address in the specified range -- you're no longer limited to localhost!).

Fjorbes Error screen shot

I use this implementation on, you can check it out by triggering a 404. The difference between this and the Fjorbes demo is that you, the end-user won't see any detail about the error on my site.

It took me about an hour to install the article's code on my site (but then I wrote it), most of this time was spent modifying the custom error page -- point to a different .css, customize the header and graphic, etc. First-time configuration is pretty quick, it should only take 5-15 minutes for most people.

Read the article. 

No Comments