about summary refs log tree commit diff
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2015-03-06T14·10+0100
committerEelco Dolstra <eelco.dolstra@logicblox.com>2015-03-06T14·10+0100
commit17c71334e16f6c65a549d95312d3f03e3c51ed98 (patch)
tree134e82c824fe8b0b85dbb5bee49177ec871c1aad
parent5badc8f9758a0547b492ea0077e50c9ffd4f8424 (diff)
forceValueDeep: Add to error prefix
-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) {