[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
01/376: Provide a more useful error message when a dynamic attr lookup f
From: |
Ludovic Courtès |
Subject: |
01/376: Provide a more useful error message when a dynamic attr lookup fails |
Date: |
Wed, 28 Jan 2015 22:03:38 +0000 |
civodul pushed a commit to tag 1.8
in repository guix.
commit eac5841970737b799c55ec78f6ace6d80762ff04
Author: Shea Levy <address@hidden>
Date: Thu May 15 11:30:46 2014 -0400
Provide a more useful error message when a dynamic attr lookup fails
---
src/libexpr/eval.cc | 12 ++++++++++--
1 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/src/libexpr/eval.cc b/src/libexpr/eval.cc
index 0f7e8e3..81abe5b 100644
--- a/src/libexpr/eval.cc
+++ b/src/libexpr/eval.cc
@@ -757,8 +757,16 @@ void ExprSelect::eval(EvalState & state, Env & env, Value
& v)
}
} else {
state.forceAttrs(*vAttrs, pos);
- if ((j = vAttrs->attrs->find(name)) == vAttrs->attrs->end())
- throwEvalError("attribute `%1%' missing, at %2%",
showAttrPath(attrPath), pos);
+ if ((j = vAttrs->attrs->find(name)) == vAttrs->attrs->end()) {
+ AttrPath staticPath;
+ AttrPath::const_iterator j;
+ for (j = attrPath.begin(); j != i; ++j)
+ staticPath.push_back(AttrName(getName(*j, state,
env)));
+ staticPath.push_back(AttrName(getName(*j, state, env)));
+ for (j = j + 1; j != attrPath.end(); ++j)
+ staticPath.push_back(*j);
+ throwEvalError("attribute `%1%' missing, at %2%",
showAttrPath(staticPath), pos);
+ }
}
vAttrs = j->value;
pos2 = j->pos;
- tag 1.8 created (now c238405), Ludovic Courtès, 2015/01/28
- 01/376: Provide a more useful error message when a dynamic attr lookup fails,
Ludovic Courtès <=
- 05/376: Shut up some signedness warnings, Ludovic Courtès, 2015/01/28
- 04/376: Ugly hack to allow --argstr values starting with a dash, Ludovic Courtès, 2015/01/28
- 06/376: Add primop ‘scopedImport’, Ludovic Courtès, 2015/01/28
- 08/376: Ensure that -I flags get included in nixPath, Ludovic Courtès, 2015/01/28
- 11/376: Rephrase @ operator description, Ludovic Courtès, 2015/01/28
- 12/376: dev-shell is a bash script, not sh, Ludovic Courtès, 2015/01/28
- 09/376: Make the Nix search path declarative, Ludovic Courtès, 2015/01/28
- 03/376: Disable parallel.sh test, Ludovic Courtès, 2015/01/28
- 10/376: Remove ExprBuiltin, Ludovic Courtès, 2015/01/28
- 02/376: nix-store -l: Fetch build logs from the Internet, Ludovic Courtès, 2015/01/28