about summary refs log tree commit diff
diff options
context:
space:
mode:
authorEelco Dolstra <e.dolstra@tudelft.nl>2004-04-02T10·49+0000
committerEelco Dolstra <e.dolstra@tudelft.nl>2004-04-02T10·49+0000
commita520b1cbc3327dfb8e3c6f503dfd0bd41e0a6d55 (patch)
tree6ebafc5e162ea4fcc5a9de0e8fee53cd580e7f8a
parentc4ac2a164af1c4198852844ae4fcfb99c7e8c110 (diff)
* Print a more useful error message in case of an invalid derivation
  binding.

-rw-r--r--src/libexpr/primops.cc7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/libexpr/primops.cc b/src/libexpr/primops.cc
index 5aefa5b411b0..835a3217f3b0 100644
--- a/src/libexpr/primops.cc
+++ b/src/libexpr/primops.cc
@@ -181,7 +181,12 @@ Expr primDerivation(EvalState & state, Expr args)
         startNest(nest, lvlVomit, format("processing attribute `%1%'") % key);
 
         Strings ss;
-        processBinding(state, value, ne, ss);
+        try {
+            processBinding(state, value, ne, ss);
+        } catch (Error & e) {
+            throw Error(format("while processing derivation binding `%1%': %2%")
+                % key % e.msg());
+        }
 
         /* The `args' attribute is special: it supplies the
            command-line arguments to the builder. */