Request: Index out of bounds error message

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

Member
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.
 
[quote author=Nightmist link=topic=504.msg2451#msg2451 date=1160281625]
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.
[/quote]

It would also be nice if it ordered a cheese pizza for you :)
 

holatuwol

Developer
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

Member
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:")
 
Top