View Single Post
Old February 17th, 2008, 02:28 AM
englere englere is offline
Friend of Wrox
Join Date: Jun 2003
Location: Atlanta, Georgia, USA.
Posts: 917
Thanks: 0
Thanked 0 Times in 0 Posts

You need to be careful with Application_Error. It can catch exceptions that occur in various places where some of those objects (in the code above) may be null and you can get further exceptions that prevent the email from being sent. If you use this type of code you should do a lot of checking for nulls also. For example:

if (Context != null && Context.Request != null)
 for (int i = 0; i < Context.Request.QueryString.Count; i++)