diff options
author | Ben Burdette <bburdette@gmail.com> | 2020-05-11 17:34:57 -0600 |
---|---|---|
committer | Ben Burdette <bburdette@gmail.com> | 2020-05-11 17:34:57 -0600 |
commit | 7c3138844ca9ab92e2f231a7d17d7aee420ae76e (patch) | |
tree | 63d316a1b18bb0a77267d2490811a8eee81adc0c /src/libexpr/nixexpr.cc | |
parent | 631642c5b40032a087b8e2e131b2ebcac00913d3 (diff) |
more pos reporting
Diffstat (limited to 'src/libexpr/nixexpr.cc')
-rw-r--r-- | src/libexpr/nixexpr.cc | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/libexpr/nixexpr.cc b/src/libexpr/nixexpr.cc index a9955f6df..91a508305 100644 --- a/src/libexpr/nixexpr.cc +++ b/src/libexpr/nixexpr.cc @@ -267,8 +267,12 @@ void ExprVar::bindVars(const StaticEnv & env) /* Otherwise, the variable must be obtained from the nearest enclosing `with'. If there is no `with', then we can issue an "undefined variable" error now. */ - if (withLevel == -1) throw UndefinedVarError("undefined variable '%1%' at %2%", name, pos); - + if (withLevel == -1) + throw UndefinedVarError( + ErrorInfo { + .hint = hintfmt("undefined variable '%1%'", name), + .nixCode = NixCode { .errPos = pos } + }); fromWith = true; this->level = withLevel; } |