Error Trapping and Error Line Number

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am using a try-catch-finally statement.

In my Catch clause, I trap an error and display the error with the .Message
property of the Exception class.

The problem is that I do not know which line within the code that the error
occurred?

I do not see a property that tells me that.

Does this mean that during the development process, I can not use the try -
catch statement? I do get a message with the line of the error when I do not
use the try catch statement.

TIA.
 
Paul,

Different parts of the exception display the line number.

During development I find it best to write the whole exception out when I
trap it with a try catch. So during development I always display ex.ToString



--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
 
Even when I print out the "entire" exception with a .tostring(), it still
does not list the line number?
 
Even when I print out the "entire" exception with a .tostring(), it still
does not list the line number?

Did you use it in DEBUG mode?
The linenumber is not shown in the exception message, but in the
stacktrace. Only is debug info is available.

Hans Kesting
 
Back
Top