public int getErrorLineNumber() { if ( node != null ) return node.getLineNumber() ; else return -1; }
/** Gets the invocation line. * @return the invocation line */ public int getInvocationLine() { final SimpleNode node = this.getNode(); if (node != null) return node.getLineNumber(); else return -1; }
/** Print the error with line number and stack trace. */ public String getMessage() { String trace; if ( node != null ) trace = " : at Line: "+ node.getLineNumber() + " : in file: "+ node.getSourceFile() + " : "+node.getText(); else // Users should not normally see this. trace = ": <at unknown location>"; if ( callstack != null ) trace = trace +"\n" + getScriptStackTrace(); return getRawMessage() + trace; }
public String getScriptStackTrace() { if ( callstack == null ) return "<Unknown>"; String trace = ""; CallStack stack = callstack.copy(); while ( stack.depth() > 0 ) { NameSpace ns = stack.pop(); SimpleNode node = ns.getNode(); if ( ns.isMethod ) { trace = trace + "\nCalled from method: " + ns.getName(); if ( node != null ) trace += " : at Line: "+ node.getLineNumber() + " : in file: "+ node.getSourceFile() + " : "+node.getText(); } } return trace; }