Bug Issues with date/time RuntimeLibrary functions.

Veracity

Developer
Staff member
Code:
int date_to_timestamp(string informat, string date);
string time_stamp_to_date(int timestamp, string outformat)
string format_date_time(string informat, string datetime, string outformat)
call Java functions to parse and generate date/time strings using the formats of your choice.
That's handy. However, you have to be careful with the formats; if you pass in a bogus one, Java will throw an exception.

We catch exceptions and turn them into runtime exceptions.
We don't throw them, so it does not abort your script.
We simply generate a ScriptException object and do nothing with it.
We DO print a Java stack trace to the DEBUG log.
And we return void, which seems to be 0, for the int return value, or "void", for the string return value.

I am sure that the Java stack trace is not useful.
Throwing the ScriptException might print an ASH or JS stack trace,
At least, the exception witll have the file/line number.
If we don't throw, print the exception?
And maybe return something other than void, since the script expects an int or a string?
 
Top