R
R
root092016-06-01 15:38:01
C++ / C#
root09, 2016-06-01 15:38:01

How to display the line number in which the error occurs in try catch?

The code:

try {
...
}
catch (Exception error)
 {
     addToLog("Error 43: " + error.Message + " : " + error.StackTrace);
 }

In case of an error, it displays:
Error 43: Object reference does not point to an instance of an object.: in the name of the Method
How to display the number of the line in which the error occurs? or something else that will help determine exactly where the error is

Answer the question

In order to leave comments, you need to log in

1 answer(s)
F
Fat Lorrie, 2016-06-01
@root09

stackoverflow.com/questions/688336/show-line-numbe...
stackoverflow.com/questions/3328990/c-sharp-get-li...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question