1, rhinoClassLoader);
} catch (JavaScriptException e) {
// exception from JavaScript (possibly wrapping a Java Ex)
if (e.getValue() instanceof Exception) {
Exception ex = (Exception)e.getValue();
throw new InterpreterException(ex, ex.getMessage(), -1, -1);
} else
throw new InterpreterException(e, e.getMessage(), -1, -1);
} catch (WrappedException we) {
// main Rhino RuntimeException
Throwable w = we.getWrappedException();
if (w instanceof Exception)
throw
new InterpreterException((Exception)we.getWrappedException(),
we.getWrappedException().getMessage(),
-1, -1);
else
throw new InterpreterException(we.getWrappedException().getMessage(), -1, -1);
} catch (RuntimeException re) {
// other RuntimeExceptions
throw new InterpreterException(re, re.getMessage(), -1, -1);
} finally {
Context.exit();
}
return rv;
}