Book Image

ASP.NET 3.5 Social Networking

By : Andrew Siemer
Book Image

ASP.NET 3.5 Social Networking

By: Andrew Siemer

Overview of this book

Table of Contents (19 chapters)

Error handling and logging


I don't think any "enterprise application" can truly be called "enterprise" if it doesn't handle errors well and notify someone to address them. In an ASP.NET site, there are basically two forms of errors—errors that you have caught, and the ones you couldn't. Pretty simple, right? Well, not so fast! Whether you have trapped an error or not, the user of your application is still going to end up with some form of disruption in their surfing experience. So we need a way to not only provide users with a smooth disruption but also to fix the disruption so that it doesn't happen again.

Error handling is the act of doing your best to trap expected or possible errors. It is also the act of not allowing ugly error messages to get in front of your customers. Logging is what we do with these errors so that we can fix them down the road.

Error handling

I am pretty sure that most of you are aware of how to catch an error using the familiar try/catch/finally syntax. To those of...