Reporting Exceptions through E-Mail (professionalaspnet.com)

submitted by docluvdocluv(1575) 4 years, 8 months ago

One of the terrible things we as developers have to deal with is unhandled exceptions, we all have them good and bad developers. The problem is that no matter how well thought out an application may be we will always have holes that we never anticipated. Unfortunately one day an end user will find it and our application will ungracefully blow up. This article is a simple error reporting routine to e-mail exception details.

4 comments |category: |Views: 14

tags: another

new Add a live kick counter to your blog >> liveImage

You can even customize the image by choosing your own colors, and then clicking the button below to update the preview and the html code:

  • "Kick It" text
  • "Kick It" background
  • kick count text
  • kick count background
  • border

Simply copy and paste this HTML into your blog post.


Users who kicked this story:
Comments:

posted by powerrushpowerrush(3873) 4 years, 8 months ago 0

What if the Exception is caused by the SMTP server? ;-)

Reply

posted by spirit1spirit1(3160) 4 years, 8 months ago 0

if the smtp fails i usually write it to a file or event log

Reply

posted by isuttleisuttle(1140) 4 years, 8 months ago 0

In my experience email is a bad idea if your exception handling is in a loop or you have large amounts of traffic to a page in error. It would be better to log to a db or text file and monitor for new errors with some sort of alert, possibly email.

Reply

posted by senfosenfo(881) 4 years, 8 months ago 0

Why not use the Exception Handling block of the Enterprise Library? That way you can define policies at runtime (simple web.config update) without rewriting code.

Reply

information Login or create an account to comment on this story