if (callFun == Scriptable.NOT_FOUND) {
callFun = "callFunction"; // this will produce a better error message
}
ScriptRuntime.call(context, callFun, thrScope, callFunArgs, thrScope);
} catch (JavaScriptException ex) {
EvaluatorException ee =
Context.reportRuntimeError(ToolErrorReporter.getMessage("msg.uncaughtJSException",
ex.getMessage()));
Throwable unwrapped = unwrap(ex);
if (unwrapped instanceof ProcessingException) {
throw (ProcessingException)unwrapped;
}
throw new CascadingRuntimeException(ee.getMessage(), unwrapped);
} catch (EcmaError ee) {
String msg = ToolErrorReporter.getMessage("msg.uncaughtJSException", ee.toString());
if (ee.getSourceName() != null) {
Context.reportRuntimeError(msg,
ee.getSourceName(),
ee.getLineNumber(),
ee.getLineSource(),
ee.getColumnNumber());
} else {
Context.reportRuntimeError(msg);
}
throw new CascadingRuntimeException(ee.getMessage(), ee);
} finally {
exitContext(thrScope);
}
}