View Full Version : Request: Index out of bounds error message
efilnikufecin
10-08-2006, 04:21 AM
In a failure of my mind I effectively tried to call substring("text", -20, -53); Well it was an error in calculations, but the problem is that kolmafia did not print an error message at all. I finally found in kolmafia.log:
Exception during call to substring. Debug log printed.
Lots of crap which you don't care to see
Caused by: java.lang.StringIndexOutOfBoundsException: String index out of range: -748
This led to my finding the error in my script, and fixing it. I'm just wondering if we could get an error message printed to the cli/gcli for when this happens in order to lessen debug time?
Nightmist
10-08-2006, 04:27 AM
I back this request!
Although my debug log auto-opened and I took a look at the error in there and automatically knew what was wrong, I might just be weird =P.
But anyway, yeah a error in the GCLI would be nice =D.
senseihitokiri
10-08-2006, 06:53 AM
I back this request!
Although my debug log auto-opened and I took a look at the error in there and automatically knew what was wrong, I might just be weird =P.
But anyway, yeah a error in the GCLI would be nice =D.
It would also be nice if it ordered a cheese pizza for you :)
holatuwol
10-08-2006, 07:14 AM
You mean something like the validation errors, except they occur at runtime instead of parse time? Given that mafia's running off a tree that it built and not reparsing a file, it has no idea about the line where the error occurred, so it might be equally cryptic.
Nightmist
10-08-2006, 07:21 AM
I personally wouldn't mind even if it was just "Substring value error" or atleast something that tells the person its the substring function thats causing mafia to error out. (You can pick that out from the debug log but I take most people take a look at the first few lines of what it prints and think 'ZOMG creepy java error stuff' and then just don't read far enough to get to the part "String index out of range:")
Powered by vBulletin® Version 4.1.12 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.