Improve error handler when fails a javascript execution in ScriptEngine