...

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



snoboarder2k6
12-10-2007, 05: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...

thanks

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

Something like:



try
{
//code that errors here
}
catch (Exception e)
{
e.printStackTrace();
}

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



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum