aboutsummaryrefslogtreecommitdiff
path: root/src/libexpr/eval.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/libexpr/eval.cc')
-rw-r--r--src/libexpr/eval.cc13
1 files changed, 5 insertions, 8 deletions
diff --git a/src/libexpr/eval.cc b/src/libexpr/eval.cc
index 1cbbb7ade..e89948b94 100644
--- a/src/libexpr/eval.cc
+++ b/src/libexpr/eval.cc
@@ -597,11 +597,6 @@ LocalNoInline(void addErrorTrace(Error & e, const char * s, const string & s2))
e.addTrace(std::nullopt, s, s2);
}
-LocalNoInline(void addErrorTrace(Error & e, const Pos & pos, const char * s, const ExprLambda & fun))
-{
- e.addTrace(pos, s, fun.showNamePos());
-}
-
LocalNoInline(void addErrorTrace(Error & e, const Pos & pos, const char * s, const string & s2))
{
e.addTrace(pos, s, s2);
@@ -1241,9 +1236,11 @@ void EvalState::callFunction(Value & fun, Value & arg, Value & v, const Pos & po
try {
lambda.body->eval(*this, env2, v);
} catch (Error & e) {
- // TODO something different for 'called from' than usual addTrace?
- // addErrorTrace(e, pos, "while evaluating %1%, called from %2%:", lambda);
- addErrorTrace(e, pos, "while evaluating %1%:", lambda);
+ addErrorTrace(e, lambda.pos, "while evaluating %s",
+ (lambda.name.set()
+ ? "'" + (string) lambda.name + "'"
+ : "anonymous lambdaction"));
+ addErrorTrace(e, pos, "from call site%s", "");
throw;
}
else