aboutsummaryrefslogtreecommitdiff
path: root/src/libexpr/attr-path.cc
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2019-04-08 14:20:58 +0200
committerEelco Dolstra <edolstra@gmail.com>2020-03-24 14:06:47 +0100
commit1eb952d27ac0714a99a5f7b0e8c7034e7ac0bc0d (patch)
tree3528dfd7aee9be9469d166e5d348a6ed1141b117 /src/libexpr/attr-path.cc
parentedc34cc1a2865777cee6b325f705fb218955b593 (diff)
findAlongAttrPath(): Throw AttrPathNotFound
(cherry picked from commit 6b0ca8e803710342af70e257935724c5ad84ca04)
Diffstat (limited to 'src/libexpr/attr-path.cc')
-rw-r--r--src/libexpr/attr-path.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libexpr/attr-path.cc b/src/libexpr/attr-path.cc
index 06b472d8b..843585631 100644
--- a/src/libexpr/attr-path.cc
+++ b/src/libexpr/attr-path.cc
@@ -70,7 +70,7 @@ Value * findAlongAttrPath(EvalState & state, const string & attrPath,
Bindings::iterator a = v->attrs->find(state.symbols.create(attr));
if (a == v->attrs->end())
- throw Error(format("attribute '%1%' in selection path '%2%' not found") % attr % attrPath);
+ throw AttrPathNotFound("attribute '%1%' in selection path '%2%' not found", attr, attrPath);
v = &*a->value;
}
@@ -82,7 +82,7 @@ Value * findAlongAttrPath(EvalState & state, const string & attrPath,
% attrPath % showType(*v));
if (attrIndex >= v->listSize())
- throw Error(format("list index %1% in selection path '%2%' is out of range") % attrIndex % attrPath);
+ throw AttrPathNotFound("list index %1% in selection path '%2%' is out of range", attrIndex, attrPath);
v = v->listElems()[attrIndex];
}