1.6. Building a Custom ASP.NET Exception Handler
In many programming situations, when a built-in framework feature doesn't suit your needs, you have the option of rolling your own. Once you've decided to do that, you have the freedom to implement any functionality you need. Let's take a moment to jot down what you think an ideal custom exception handler should be and do — a "wish list," if you will.
It should capture other information about the state of the application at the point of failure, besides just the exception.
It should allow you to redirect to a nice custom error page of your choosing, using either Response.Redirect or Server.Transfer as you see fit.
It should store the exception and all of the other captured information in state, ...
Get Robust ASP.NET Exception Handling now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.