public void visit_trycatch(TryCatchStmt trycatch_stmt) { try { execute(trycatch_stmt.try_body); }catch (WavyException exception) { WavyFunction function = new WavyFunction(trycatch_stmt.catch_body, this.local_scope, false); // We want to create a new instance of a WavyException here Callable exception_class = (Callable)WavyNamespace.get_var_in_namespace(this.local_scope, "exception", "Exception"); function.call(this, new List <object>() { exception_class.call(this, new List <object>() { "[Caught Exception] " + exception.errror_msg }) } ); } }
public void visit_trycatch(TryCatchStmt trycatch_stmt) { try { execute(trycatch_stmt.try_body); }catch (PlutoException exception) { PlutoFunction function = new PlutoFunction(trycatch_stmt.catch_body, this.local_scope, false); // We want to create a new instance of a plutoexception here Callable exception_class = (Callable)namespaces["exception"].get(new Token(Token.Type.Identifier, "Exception")); function.call(this, new List <object>() { exception_class.call(this, new List <object>() { "[Caught Exception] " + exception.error_msg }) } );; } }
public void visit_trycatch(TryCatchStmt trycatch_stmt) { resolve(trycatch_stmt.try_body); resolve_function(trycatch_stmt.catch_body, FunctionType.Function); }