From 9088dee9e265db8176b61e53ac43a916fdd34a3d Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Wed, 8 Mar 2006 14:11:19 +0000 Subject: * Some refactoring of the exception handling code so that we can catch Nix expression assertion failures. --- src/libexpr/primops.cc | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src/libexpr/primops.cc') diff --git a/src/libexpr/primops.cc b/src/libexpr/primops.cc index 310bca5ae97f..31fff0b493e8 100644 --- a/src/libexpr/primops.cc +++ b/src/libexpr/primops.cc @@ -244,8 +244,9 @@ static Expr primDerivationStrict(EvalState & state, const ATermVector & args) try { processBinding(state, value, drv, ss); } catch (Error & e) { - throw Error(format("while processing the derivation attribute `%1%' at %2%:\n%3%") - % key % showPos(pos) % e.msg()); + e.addPrefix(format("while processing the derivation attribute `%1%' at %2%:\n") + % key % showPos(pos)); + throw; } /* The `args' attribute is special: it supplies the @@ -547,8 +548,9 @@ static Expr primDependencyClosure(EvalState & state, const ATermVector & args) } } catch (Error & e) { - throw Error(format("while finding dependencies in `%1%':\n%2%") - % path % e.msg()); + e.addPrefix(format("while finding dependencies in `%1%':\n") + % path); + throw; } } -- cgit 1.4.1