diff options
author | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2013-10-08 14:45:36 +0200 |
---|---|---|
committer | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2013-10-08 14:45:36 +0200 |
commit | b1e3b1a4ac8c276f503713f6002c3b42efef2ae8 (patch) | |
tree | 9cb4941efd09e0ec8c962c81d9907ee8e19a5787 /src/libexpr/nixexpr.cc | |
parent | 6b47de580ffe6101863a1054d9d47f9cbe691214 (diff) |
Treat undefined variable errors consistently
Previously, a undefined variable inside a "with" caused an EvalError
(which can be caught), while outside, it caused a ParseError (which
cannot be caught). Now both cause an UndefinedVarError (which cannot
be caught).
Diffstat (limited to 'src/libexpr/nixexpr.cc')
-rw-r--r-- | src/libexpr/nixexpr.cc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libexpr/nixexpr.cc b/src/libexpr/nixexpr.cc index 03a14695f..28049bb0d 100644 --- a/src/libexpr/nixexpr.cc +++ b/src/libexpr/nixexpr.cc @@ -198,7 +198,7 @@ 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 ParseError(format("undefined variable `%1%' at %2%") % name % pos); + if (withLevel == -1) throw UndefinedVarError(format("undefined variable `%1%' at %2%") % name % pos); fromWith = true; this->level = withLevel; |