aboutsummaryrefslogtreecommitdiff
path: root/src/libexpr/eval.cc
diff options
context:
space:
mode:
authorBen Burdette <bburdette@gmail.com>2020-06-30 15:44:19 -0600
committerBen Burdette <bburdette@gmail.com>2020-06-30 15:44:19 -0600
commit70bcb39d3fe272164c122979ee36cf2f2ea8f084 (patch)
tree0506346b49e1b974401f25f2efd909f6dfbb89d7 /src/libexpr/eval.cc
parentddb81ca126864dbf920472688bcd3a80c7a7e73b (diff)
double addtrace for 'called from'
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