@Override public EvaluatorException runtimeError(final String message, final String sourceName, final int line, final String lineSource, final int lineOffset) { return new EvaluatorException(message, filename, line, lineSource, lineOffset); }
if ( e.getCause() instanceof EvaluatorException ) { EvaluatorException ee = (EvaluatorException) e.getCause(); location = "--> " + ee.lineNumber() + ":" + ee.columnNumber();
} catch ( EvaluatorException Signal ) { Context.reportError( "EvaluatorException while evaluating file \"" + fileName + "\" (reason: \"" + Signal.getMessage() + "\")" ); } catch ( JavaScriptException Signal ) { Context.reportError( "JavaScriptException while evaluating file \""
/** * This is a V8 extension that causes a native Error object to have a stack trace inserted at the point * at which it's called. It takes two arguments -- the first is an Error object and the second * is an optional function name for trimming the stack trace. We will only implement the first. */ private static Object js_captureStackTrace(Context cx, Scriptable scope, Object[] args) { if (args.length < 1) { throw ScriptRuntime.typeError("first argument must be an Object"); } Scriptable obj; try { obj = (Scriptable)args[0]; } catch (ClassCastException cce) { throw ScriptRuntime.typeError("err must be an Object"); } EvaluatorException exc = new EvaluatorException(null); exc.fillInStackTrace(); Object stack = exc.getPreparedScriptStackTrace(cx, scope, obj); obj.delete("stack"); obj.put("stack", obj, stack); return Undefined.instance; }
public void addJavascript(Reader reader, String name, int lineno) throws Exception { try { Script script = cx.compileReader(reader, name, lineno, null); script.exec(cx, scope); } catch(EvaluatorException e) { for(JavascriptRunnerListener listener : listeners){ listener.compileError(e.details(), e.sourceName(), e.lineNumber(), e.columnNumber()); } throw e; } catch(Exception e) { reportUnexpectedError(e); throw e; } }
protected void appendError(StringBuffer errors, int errorCount, EvaluatorException e) { errors.append(errorCount); errors.append(". "); String message = e.getMessage(); errors.append(message); errors.append(" at column "); errors.append(e.columnNumber()); String lineSource = e.lineSource(); if (lineSource != null) { errors.append(" in line\n"); errors.append(lineSource); } errors.append("\n"); }
message.append("Failed to initialize Typescript compiler\nerror on line " + e.lineNumber() + ": " + e.details() + "\n" + e.lineSource() + "\n"); for (int x = 0; x < e.columnNumber() - 1; x++) { message.append(" ");
/** * @deprecated Use {@link RhinoException#columnNumber()} from the super class. */ public int getColumnNumber() { return columnNumber(); }
/** * @deprecated Use {@link RhinoException#lineNumber()} from the super class. */ public int getLineNumber() { return lineNumber(); }
/** * @deprecated Use {@link RhinoException#lineSource()} from the super class. */ public String getLineSource() { return lineSource(); }
/** * @deprecated Use {@link RhinoException#sourceName()} from the super class. */ public String getSourceName() { return sourceName(); }
/** * @deprecated Use {@link RhinoException#columnNumber()} from the super class. */ public int getColumnNumber() { return columnNumber(); }
/** * @deprecated Use {@link RhinoException#lineNumber()} from the super class. */ public int getLineNumber() { return lineNumber(); }
/** * @deprecated Use {@link RhinoException#lineSource()} from the super class. */ public String getLineSource() { return lineSource(); }
/** * @deprecated Use {@link RhinoException#sourceName()} from the super class. */ public String getSourceName() { return sourceName(); }
@Override public EvaluatorException runtimeError(String message, String sourceName, int line, String lineSource, int lineOffset) { if (sourceName == null) { sourceName = filename; } error(message, sourceName, line, lineSource, lineOffset); return new EvaluatorException(message); }
String position = "(" + e.lineNumber() + ":" + e.columnNumber() + ")"; String message = BaseMessages.getString( PKG, "ScriptDialog.Exception.CouldNotExecuteScript", position ); testException = new KettleException( message, e );
/** * @deprecated * @see #jsToJava(Object, Class) * @throws IllegalArgumentException if the conversion cannot be performed. * Note that {@link #jsToJava(Object, Class)} throws * {@link EvaluatorException} instead. */ @Deprecated public static Object toType(Object value, Class<?> desiredType) throws IllegalArgumentException { try { return jsToJava(value, desiredType); } catch (EvaluatorException ex) { IllegalArgumentException ex2 = new IllegalArgumentException(ex.getMessage()); Kit.initCause(ex2, ex); throw ex2; } }
/** * @deprecated Use {@link RhinoException#columnNumber()} from the super class. */ public int getColumnNumber() { return columnNumber(); }
/** * @deprecated Use {@link RhinoException#lineNumber()} from the super class. */ public int getLineNumber() { return lineNumber(); }