Error Handling

  • Thread starter Thread starter Joe
  • Start date Start date
J

Joe

Hello,

Any suggestions on error handling for a web application? Anyone use error
handling block in Enterprise Library?

Thanks
 
95% of all the exceptions that happen can't be handled. Most people "handle"
exceptions by "swallowing" them and going about their business. If you can't
connect to your DB, you can't do anything, you SHOULD log the error and
display a message to the user (even if it's generic).


Catch the error in global.asax's Application_OnError (or an HttpModules) and
log it using the Logging Application Block or Log4Net.

Here's an example I once posted with an HttpModule and Log4Net.

http://codebetter.com/blogs/karlseguin/archive/2006/06/12/146356.aspx

Karl
 
Back
Top