about summary refs log tree commit diff
path: root/src/libexpr/primops.cc
diff options
context:
space:
mode:
authorEelco Dolstra <e.dolstra@tudelft.nl>2006-03-08T14·11+0000
committerEelco Dolstra <e.dolstra@tudelft.nl>2006-03-08T14·11+0000
commit9088dee9e265db8176b61e53ac43a916fdd34a3d (patch)
tree42abd16be1b9bc4e4b5b4defdcd44b5bd9972740 /src/libexpr/primops.cc
parentfa72ae1e9cad0dded28b965fe97293bbeeac031e (diff)
* Some refactoring of the exception handling code so that we can catch
  Nix expression assertion failures.

Diffstat (limited to 'src/libexpr/primops.cc')
-rw-r--r--src/libexpr/primops.cc10
1 files changed, 6 insertions, 4 deletions
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;
         }
     }