/** Override toEvalError to throw TargetError type. */ public EvalError toEvalError( String msg, SimpleNode node, CallStack callstack ) { if ( msg == null ) msg = getMessage(); else msg = msg + ": " + getMessage(); return new TargetError( msg, t, node, callstack, false ); } }
type, dimensionsNode.definedDimensions); } catch( NegativeArraySizeException e1 ) { throw new TargetError( e1, node, callstack ); } catch( Exception e ) { throw new EvalError("Can't construct primitive array: " +
public Object eval( CallStack callstack, Interpreter interpreter) throws EvalError { Object obj = ((SimpleNode) jjtGetChild(0)).eval(callstack, interpreter); if(!(obj instanceof Throwable)) throw new EvalError("Expression in 'throw' must be Throwable type", this, callstack ); // wrap the exception in a TargetException to propagate it up throw new TargetError( (Throwable) obj, this, callstack ); } }
@Override public Object visit(BSHThrowStatement node) { Object obj = ((SimpleNode)node.jjtGetChild(0)).accept(this); // need to loosen this to any throwable... do we need to handle // that in interpreter somewhere? check first... if(!(obj instanceof Exception)) throw new EvalError("Expression in 'throw' must be Exception type", node, callstack ); // wrap the exception in a TargetException to propogate it up throw new TargetError( (Exception)obj, node, callstack ); }
/** Override toEvalError to throw TargetError type. */ public EvalError toEvalError( String msg, SimpleNode node, CallStack callstack ) { if ( null == msg ) msg = this.getMessage(); else msg += ": " + this.getMessage(); return new TargetError( msg, this.getCause(), node, callstack, false ); } }
return arr; } catch( NegativeArraySizeException e1 ) { throw new TargetError( e1, this, callstack ); } catch( Exception e ) { throw new EvalError("Can't construct primitive array: "
throw new TargetError("Object constructor", e.getTargetException(), node, callstack, true); } finally { if (isGeneratedClass) {
isNative = false; throw new TargetError( msg, te, node, callstack, isNative );
isNative = false; throw new TargetError( msg, te, this, callstack, isNative );
throw new TargetError("Object constructor", e.getTargetException(), this, callstack, true); } finally { if (isGeneratedClass) {
isNative = false; throw new TargetError( msg, te, this, callstack, isNative ); } catch ( UtilEvalError e ) { throw e.toEvalError( this, callstack );
isNative = false; throw new TargetError( msg, te, node, callstack, isNative ); } catch ( UtilEvalError e ) { throw e.toEvalError( node, callstack );
"Error invoking Java method: "+e, callerInfo, callstack ); } catch ( InvocationTargetException e2 ) { throw new TargetError( "Exception invoking imported object method.", e2, callerInfo, callstack, true/*isNative*/ );
throw new TargetError(thrown, this, callstack);
+ tokenImage[kind], this, callstack); } catch (NullPointerException e) { throw new TargetError(e, this, callstack); } catch (UtilEvalError e) { e.toEvalError(this, callstack);
"Error invoking Java method: "+e, callerInfo, visitor.getCallstack() ); } catch ( InvocationTargetException e2 ) { throw new TargetError( "Exception invoking imported object method.", e2, callerInfo, visitor.getCallstack(), true/*isNative*/ );
throw new TargetError( "target exception", e.getTargetException(), node, callstack, true);