View Full Version : Identifying the source of an error in a try block

12-10-2007, 04:50 PM
I was wondering if there was anyway to do this. I have a try block that's like 300 lines long, and I keep getting stringindexoutofbounds errors, and I can't find where they're coming from.

I can identify the type of the error in the catch block by printing the exception, I just can't figure out where its from...


12-10-2007, 05:00 PM
if you use the printStackTrace method when you catch the exception, it will usually give you a line number.

Something like:

//code that errors here
catch (Exception e)

12-10-2007, 05:11 PM
and there it is. Thanks, that worked perfectly

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum