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?
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?