What to do when the sky starts falling down
I came across this post about dealing with unhandled ASP .NET exceptions on the blog of one of the Microsoft escalation engineers. It also mentions a Knowledge Base article on creating a custom HTTPHandler module to trap unhandled exceptions that may occur during the execution of an ASP .NET application.
When we were writing the current version of Cognitio Search we put a lot of effort into adding exception handlers for a wide range of exceptions which might be caused by expected unexpected (if that makes sense) events. We also wrote a component which traps these exceptions and uses a custom work item type to log them as an error in our Team Foundation Server with full stack trace and information on the components that caused the problem. So if an exceptional but anticipated event occurs, such as the server losing contact with the Domain Controller for some reason, we will be notified of this failure via the Team Foundation Server and it will also be recorded in the event logs.
But what happens if the sky really starts falling down around our head and something completely unexpected happens? (e.g. a sudden and catastrophic failure of the disk that holds the files of the ASP .NET web site). In this event ASP .NET will generate an exception that we currently have no mechanism to catch. Sure, an ASP .NET failure event will appear in the system event logs, but we don't get the notification or any details of the error back in our Team Foundation Server.
Having looked at this post and the KB info on creating a custom HTTPHandler for unhandled exceptions, I think I may adapt this technique and introduce it into the next release of Cognitio Search so that any truly unexpected exceptions can be caught, diagnostic information captured and inserted into our Team Foundation work item store. This will certainly help us give better support to Cognitio users and help us get a deeper understanding of any issues that we hadn't anticipated.
When I get round to it I'll post an article showing how we created our TFS remote bug logger using ASP .NET web services and I'll also post any modifications I make to allow it to deal with the totally unexpected ASP .NET exceptions.
del.ico.us | Digg It | Technorati | StumbleUpon | Furl | reddit