* tryEval shouldn't catch all exceptions of type Error, since not all

of them leave the evaluator in a continuable state.  Also, it should
  be less chatty.
This commit is contained in:
Eelco Dolstra 2009-09-23 19:19:26 +00:00
parent 63a17d4bd5
commit 1332dd1ed3

View File

@ -232,8 +232,8 @@ static Expr prim_tryEval(EvalState & state, const ATermVector & args)
Expr val = evalExpr(state, args[0]); Expr val = evalExpr(state, args[0]);
res.set(toATerm("value"), makeAttrRHS(val, makeNoPos())); res.set(toATerm("value"), makeAttrRHS(val, makeNoPos()));
res.set(toATerm("success"), makeAttrRHS(eTrue, makeNoPos())); res.set(toATerm("success"), makeAttrRHS(eTrue, makeNoPos()));
} catch (Error & e) { } catch (AssertionError & e) {
printMsg(lvlInfo, format("tryEval caught an error: %1%: %2%") % e.prefix() % e.msg()); printMsg(lvlDebug, format("tryEval caught an error: %1%: %2%") % e.prefix() % e.msg());
res.set(toATerm("value"), makeAttrRHS(eFalse, makeNoPos())); res.set(toATerm("value"), makeAttrRHS(eFalse, makeNoPos()));
res.set(toATerm("success"), makeAttrRHS(eFalse, makeNoPos())); res.set(toATerm("success"), makeAttrRHS(eFalse, makeNoPos()));
} }