1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-27 00:11:17 +02:00

* Turn build errors during evaluation into EvalErrors.

This commit is contained in:
Eelco Dolstra 2010-06-01 11:19:32 +00:00
parent 8bcdd36f10
commit 89865da76d
4 changed files with 7 additions and 4 deletions

View file

@ -37,7 +37,11 @@ static void prim_import(EvalState & state, Value * * args, Value & v)
throw EvalError(format("cannot import `%1%', since path `%2%' is not valid")
% path % *i);
if (isDerivation(*i))
store->buildDerivations(singleton<PathSet>(*i));
try {
store->buildDerivations(singleton<PathSet>(*i));
} catch (Error & e) {
throw ImportError(e.msg());
}
}
state.evalFile(path, v);