aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDavHau <42246742+DavHau@users.noreply.github.com>2020-03-25 07:19:00 +0000
committerDavHau <42246742+DavHau@users.noreply.github.com>2020-04-11 10:54:26 +0000
commitfc14213d2da7302b237dfe5ca51f6f4d9af34e5c (patch)
treee00b470f31c3658708524711f2c2e0ef435da47e /src
parent0a10854f857e519d1455ff0f0be1f8401c40a11c (diff)
improve toFile error message when containing potential drv path
Diffstat (limited to 'src')
-rw-r--r--src/libexpr/primops.cc4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/libexpr/primops.cc b/src/libexpr/primops.cc
index 8de234951..6d7622900 100644
--- a/src/libexpr/primops.cc
+++ b/src/libexpr/primops.cc
@@ -1021,7 +1021,9 @@ static void prim_toFile(EvalState & state, const Pos & pos, Value * * args, Valu
for (auto path : context) {
if (path.at(0) != '/')
- throw EvalError(format("in 'toFile': the file '%1%' cannot refer to derivation outputs, at %2%") % name % pos);
+ throw EvalError(format(
+ "in 'toFile': the file named '%1%' must not contain a reference "
+ "to a derivation but contains (%2%), at %3%") % name % path % pos);
refs.insert(state.store->parseStorePath(path));
}