Java return line of the error
Iam trieing to print an error with a linenumber where the error is at.
Here is a part of my code.
What i would like to show at i is the linenumber where the error is.
throw new FileException("\r\nTurn <" + turns + "> contains zero darts" , i , file, turns);
turns is filled by inserting a file
while((turns = reader.readLine()) != null)
Re: Java return line of the error
I think there is a way to get the contents of the stack trace into a variable.
Then you would have to scan the contents of that variable to find the line number you are interested in.