TheSwamp

Code Red => VB(A) => Topic started by: David Hall on October 15, 2007, 03:08:52 PM

Title: Email on Error
Post by: David Hall on October 15, 2007, 03:08:52 PM
I have never tried this, nor do I know where to begin, but here goes.  Is there a way to tie an Unhandled Error to an email so that when a user breaks something (read finds an error I didn't account for) I can get an email telling me which module, and which line?
Title: Re: Email on Error
Post by: Guest on October 15, 2007, 03:50:33 PM
Maybe this will be of some help??

http://www.theswamp.org/index.php?topic=12796.0
Title: Re: Email on Error
Post by: Bob Wahr on October 15, 2007, 04:46:16 PM
Duh,

I did this a few years ago.  Doubt I still have it although it's possible but I will rework it if needed. I think I referenced the Outlook library for the emailing part, used err.Source for the file name, set a string to the sub name at the beginning of the sub, and I think I just had the error, not the line it occurred on.  Not sure how to get that but will look into it when I have some time.
Title: Re: Email on Error
Post by: Bob Wahr on October 15, 2007, 04:47:31 PM
MattW's answer > mine
Title: Re: Email on Error
Post by: Guest on October 16, 2007, 08:19:43 AM
If your office is like mine you might have a hard time getting the email to be sent automatically (if the IT twits have restrictions in place to guard against that type of thing).  An alternative is to log the error, program name, module, user, time, etc... to a log file on the network somewhere - a location that everyone has read/write access to of course.  Or maybe individual logs with the user's name as the filename to easily keep track of who's breaking what??!?
Title: Re: Email on Error
Post by: David Hall on October 16, 2007, 09:29:43 AM
hadnt thought of that, might give that a try