about summary refs log tree commit diff
path: root/src/libexpr/primops.cc
diff options
context:
space:
mode:
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;
         }
     }