From 17c71334e16f6c65a549d95312d3f03e3c51ed98 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Fri, 6 Mar 2015 15:10:12 +0100 Subject: forceValueDeep: Add to error prefix --- src/libexpr/eval.cc | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src') 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) { -- cgit 1.4.1