Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Does anyone have any tips/resources

Status
Not open for further replies.

krisbrixon

Programmer
May 10, 2002
371
US
Does anyone have any tips/resources/code/... for handling error messages beyond the simple messagebox.

My goal is to throw the error all the way up to the GUI class (I can do that) and then gather as much debugging/environemnt information as possible and write to a file or something.

A little background info:
Our old program (written in Clipper) when you got an error it would show the last 20 function calls and what line it was on. This allowed us to pinpoint where the customer received the error and show the path to the error message. I would love to do something like this (or better) in VB.NET.

On the following page you can see some functions I found dealing with error handling, but they are not much more than the simple messagebox error messages.


Any tips / resources / code / articles / .... that are beyond the simple error handling you see in all the books would be greatly appreciated!!

Kris
[cheers]
 
Wouldn't creating a new StackTrace instance at the beginning of the class--

Then using a try/catch block give you enough information?

When the exception is caught, you could do a StackTrace.ToString() method on each of the ST's and write them off into a text file or a local Access file or something similar.
 
Kris,

Throwing an error up through the classes isn't recommended. I can't remember the exact figure but each throw takes around 12 times as long as handling within a class. Info from Balena's book.

Craig
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top