Exception error message has wrong line number

A

Arthur Parker

I've been having a problem occasionally with exceptions having the wrong line
number listed. The situation is this:
I have a function with a try-catch, and in the catch it logs the message and
stack trace from the exception. The code generates an index-out-of-bounds
exception. When I look at the line number listed in the stack trace, it is
the first line of code in the function, which has nothing to do with array
indexes. One time this happened, I had to add a debug variable that kept
track of which section of code was executing and add that to the error
message.
I've had this happen several times with different code, and different
functions, but always an index-out-of-bounds, and always pointing to the
first line of the code inside the try block.
Does anyone have an explanation for this odd behavior?
 
A

Arthur Parker

That's possible, although I went through several changes and re-compilations,
so the pdb file should have been updated during the process. The especially
odd part is that I haven't noticed this behavior with any other kind of
exceptions.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top