vb.net Error Object

vb.net Error Object

Post by Fred Nelso » Wed, 27 Oct 2004 10:17:05


Hi:

I'm writing an error handling routine for my VB.NET program. I have a
routine that is called when an error occurs using "on error goto' as in a
class library which then loads the first form in the system.

When I encounter an error I'm using err.number for the error number,
err.description for the description of what went wrong.

What I really need to complete the process is the name of the form on which
the error occurred and the line number.

I would really appreciate it if someone knows how to obtain this
information - or if there are additional steps that I need to take in each
form to collect it.

Thanks,

Fred
 
 
 

vb.net Error Object

Post by jjardin » Wed, 27 Oct 2004 11:02:43


Any thought of using Try Catch blocks instead of using On Error GoTo?

In regards to the err line information there was a function ERL
that would report line numbers Here is some info on it..
http://www.yqcomputer.com/

 
 
 

vb.net Error Object

Post by Fred Nelso » Wed, 27 Oct 2004 11:23:49

Hi Jjardine:

I need to trap completely unexpected errors (such as bad indexes) so the try
/ catch / end try block won't help me with this function. I've used it
where appropriate - such as database access.

Since my startup and error trapping occurs in a class library the ERL
function always returns a line number of zero. I'm hoping to get the form
that caused the error along with the line number for quick debugging should
there be a crash.

If you have any ideas they would be greatly appreciated!

Thanks,

Fred





a
each