Skip to content

Instantly share code, notes, and snippets.

@purplefox
Created February 20, 2015 09:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save purplefox/003fae1e32fd44368ffa to your computer and use it in GitHub Desktop.
Save purplefox/003fae1e32fd44368ffa to your computer and use it in GitHub Desktop.
try {
exports = (ScriptObjectMirror) engine.eval("require.noCache('" + verticleName + "');");
} catch (ScriptException e) {
Throwable t = e.getCause();
if (t instanceof ECMAException) {
ECMAException ee = (ECMAException)t;
Object ea = ee.getEcmaError();;
if (ea instanceof ScriptObjectMirror) {
ScriptObjectMirror som = (ScriptObjectMirror)ea;
String fileName = (String)som.getMember("fileName");
int lineNumber = (int)som.getMember("lineNumber");
ScriptException newex = new ScriptException(e.getMessage(), fileName, lineNumber);
startFuture.fail(newex);
throw newex;
}
}
throw e;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment