Trap all errors

  • Thread starter Thread starter Andrew Banks
  • Start date Start date
A

Andrew Banks

Is it possible to trap all errors within a web app and do the following

Send the user to another page "Error.aspx"
Send an email to myself with the filename and as much information about the
error as possible.

I take it this would be done in the Global.asax file but not too sure where
to start.

Any ideas greatly appreciated!
 
You could also use the Exception Management Application Block, catch
unhandled exceptions, and publish them using a custom publisher. This would
have the advantage of giving you the ability to publish to the application
log simultaneously, while your custom publisher might screen exceptions and
only email certain ones (or just send an alert so the administrator could go
back and check the log).
 
Back
Top