本文整理汇总了Java中org.mozilla.javascript.RhinoException.printStackTrace方法的典型用法代码示例。如果您正苦于以下问题:Java RhinoException.printStackTrace方法的具体用法?Java RhinoException.printStackTrace怎么用?Java RhinoException.printStackTrace使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.mozilla.javascript.RhinoException
的用法示例。
在下文中一共展示了RhinoException.printStackTrace方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onScriptError
import org.mozilla.javascript.RhinoException; //导入方法依赖的package包/类
@Override
public void onScriptError(ScriptRunner runner, RhinoException error) {
if (runner == missionScriptRunner) {
error.printStackTrace();
stop();
}
}
示例2: onScriptError
import org.mozilla.javascript.RhinoException; //导入方法依赖的package包/类
@Override
public void onScriptError(ScriptRunner runner, RhinoException error) {
codeEditorView.getTextArea().setErrorLine(error.lineNumber(), error.columnNumber(), error.getLocalizedMessage());
setEditorVisibility(true);
error.printStackTrace();
BotLogic.audio.codeError.play();
}
示例3: eval
import org.mozilla.javascript.RhinoException; //导入方法依赖的package包/类
public Object eval(Reader reader, ScriptContext ctxt)
throws ScriptException {
Object ret;
Context cx = enterContext();
try {
Scriptable scope = getRuntimeScope(ctxt);
String filename = (String) get(ScriptEngine.FILENAME);
filename = filename == null ? "<Unknown source>" : filename;
ret = cx.evaluateReader(scope, reader, filename, 1, null);
} catch (RhinoException re) {
if (DEBUG) {
re.printStackTrace();
}
int line = (line = re.lineNumber()) == 0 ? -1 : line;
String msg;
if (re instanceof JavaScriptException) {
msg = String.valueOf(((JavaScriptException) re).getValue());
} else {
msg = re.toString();
}
ScriptException se = new ScriptException(msg, re.sourceName(), line);
se.initCause(re);
throw se;
} catch (IOException ee) {
throw new ScriptException(ee);
} finally {
cx.exit();
}
return unwrapReturnValue(ret);
}
示例4: invoke
import org.mozilla.javascript.RhinoException; //导入方法依赖的package包/类
private Object invoke(Object thiz, String name, Object... args)
throws ScriptException, NoSuchMethodException {
Context cx = enterContext();
try {
if (name == null) {
throw new NullPointerException("method name is null");
}
if (thiz != null && !(thiz instanceof Scriptable)) {
thiz = cx.toObject(thiz, topLevel);
}
Scriptable engineScope = getRuntimeScope(context);
Scriptable localScope = (thiz != null) ? (Scriptable) thiz
: engineScope;
Object obj = ScriptableObject.getProperty(localScope, name);
if (!(obj instanceof Function)) {
throw new NoSuchMethodException("no such method: " + name);
}
Function func = (Function) obj;
Scriptable scope = func.getParentScope();
if (scope == null) {
scope = engineScope;
}
Object result = func.call(cx, scope, localScope,
wrapArguments(args));
return unwrapReturnValue(result);
} catch (RhinoException re) {
if (DEBUG) {
re.printStackTrace();
}
int line = (line = re.lineNumber()) == 0 ? -1 : line;
throw new ScriptException(re.toString(), re.sourceName(), line);
} finally {
cx.exit();
}
}