From 89865da76d87292e5bc61f324b1ac892d40236e7 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Tue, 1 Jun 2010 11:19:32 +0000 Subject: * Turn build errors during evaluation into EvalErrors. --- src/libexpr/primops.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/libexpr/primops.cc') diff --git a/src/libexpr/primops.cc b/src/libexpr/primops.cc index 9d36fb6a05d7..42c8586116aa 100644 --- a/src/libexpr/primops.cc +++ b/src/libexpr/primops.cc @@ -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(*i)); + try { + store->buildDerivations(singleton(*i)); + } catch (Error & e) { + throw ImportError(e.msg()); + } } state.evalFile(path, v); -- cgit 1.4.1