about summary refs log tree commit diff
path: root/src/libexpr/eval.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/libexpr/eval.cc')
-rw-r--r--src/libexpr/eval.cc9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/libexpr/eval.cc b/src/libexpr/eval.cc
index 4404e04eb07e..7d1c3c2b9895 100644
--- a/src/libexpr/eval.cc
+++ b/src/libexpr/eval.cc
@@ -1226,8 +1226,13 @@ void EvalState::forceValueDeep(Value & v)
         forceValue(v);
 
         if (v.type == tAttrs) {
-            foreach (Bindings::iterator, i, *v.attrs)
-                recurse(*i->value);
+            for (auto & i : *v.attrs)
+                try {
+                    recurse(*i.value);
+                } catch (Error & e) {
+                    addErrorPrefix(e, "while evaluating the attribute ‘%1%’ at %2%:\n", i.name, *i.pos);
+                    throw;
+                }
         }
 
         else if (v.type == tList) {