Fix for problem:
There is a bug in JavaScriptException which prevents it from being used with out a Rhino Context. When the getMessage() method is invoked on it, the exception goes to the ScriptRuntime to toString the value. If you have already exited your context, the runtime will throw an error. The solution is to simply remove the overridden getMessage method from JavaScriptException. JavaScriptException's constructor calls the Exception constructor with the toString'ed value. The default implementation of getMessage will return the exception message. Jeff git-svn-id: svn://10.0.0.236/trunk@104772 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
parent
64e89c6e99
commit
581316da9c
@ -58,15 +58,6 @@ public class JavaScriptException extends Exception {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the exception message.
|
||||
*
|
||||
* <p>Will just convert the wrapped exception to a string.
|
||||
*/
|
||||
public String getMessage() {
|
||||
return ScriptRuntime.toString(value);
|
||||
}
|
||||
|
||||
static JavaScriptException wrapException(Scriptable scope,
|
||||
Throwable exn)
|
||||
{
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user