Merge pull request #4967 from Pamplemousse/specific_errors

Prefer to throw specific errors
This commit is contained in:
Domen Kožar
2021-07-03 10:34:56 +02:00
committed by GitHub
4 changed files with 6 additions and 6 deletions
+1 -1
View File
@@ -920,7 +920,7 @@ void EvalState::evalFile(const Path & path_, Value & v, bool mustBeTrivial)
// computation.
if (mustBeTrivial &&
!(dynamic_cast<ExprAttrs *>(e)))
throw Error("file '%s' must be an attribute set", path);
throw EvalError("file '%s' must be an attribute set", path);
eval(e, v);
} catch (Error & e) {
addErrorTrace(e, "while evaluating the file '%1%':", path2);