Error Handling

J

Joe

Hello,

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

Thanks
 
K

Karl Seguin [MVP]

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top