Reputation: 988
I'm catching exceptions on global.asax Application_Error. I want to filters exceptions by type to redirect some specified types using Response.Redirect or Server.Transfer and to allow others to be redirected on the specified defaultRedirect from web.config.
I've been googling around for some time to get list of exception types. Anyone here who can give me the list or can give me a link?
Thanks!
Upvotes: 0
Views: 5802
Reputation: 11
System.IO.IOException Handles I/O errors.
System.IndexOutOfRangeException Handles errors generated when a method refers to an array index out of range.
System.ArrayTypeMismatchException Handles errors generated when type is mismatched with the array type.
System.NullReferenceException Handles errors generated from deferencing a null object.
System.DivideByZeroException Handles errors generated from dividing a dividend with zero.
System.InvalidCastException Handles errors generated during typecasting.
System.OutOfMemoryException Handles errors generated from insufficient free memory.
System.StackOverflowException Handles errors generated from stack overflow.
Upvotes: 1
Reputation: 239636
There isn't a definitive list - anyone can define a new exception type and throw it.
You're better off dealing with specific exceptions that you know how to handle, and leave all others to a general exception handler that (hopefully) logs the exception somewhere, and gives a general error page.
Upvotes: 2