* 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
1 changed files with 2 additions and 2 deletions

View File

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