* 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

@ -15,6 +15,7 @@ MakeError(AssertionError, EvalError)
MakeError(ThrownError, AssertionError)
MakeError(Abort, EvalError)
MakeError(TypeError, EvalError)
MakeError(ImportError, EvalError) // error building an imported derivation
/* Position objects. */

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);

View file

@ -267,7 +267,7 @@ public:
MakeError(SubstError, Error)
MakeError(BuildError, Error) /* denoted a permanent build failure */
MakeError(BuildError, Error) /* denotes a permanent build failure */
//////////////////////////////////////////////////////////////////////

View file

@ -16,8 +16,6 @@ namespace nix {
typedef std::map<Path, Path> Roots;
struct GCOptions
{
/* Garbage collector operation: