diff options
author | Silvan Mosberger <silvan.mosberger@tweag.io> | 2023-11-08 23:59:04 +0100 |
---|---|---|
committer | Silvan Mosberger <silvan.mosberger@tweag.io> | 2023-11-08 23:59:04 +0100 |
commit | 0ace383438b84b0db04b4103d0b2d73400294058 (patch) | |
tree | 270effde7c9824bb9bfc467d3cc8965c267eded4 /lib/fileset/internal.nix | |
parent | 2556605a356c59a7269f601f56e9271ed3f487d1 (diff) |
lib.fileset: Make error messages more uniform
Just minor changes like: - Always using "X is a Y, but it should be Z" - "X is a path that does not exist" rather than "X does not exist" - Always using multi-line strings for errors - Always quoting string-like values and not quoting path-like values - But do quote filesystem roots. Even though they're paths, they might be very small, good to have quotes to know the start/end - Capitalise the first word - Distinguish root vs filesystem root more
Diffstat (limited to 'lib/fileset/internal.nix')
-rw-r--r-- | lib/fileset/internal.nix | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/fileset/internal.nix b/lib/fileset/internal.nix index b919a5de3eef4..853115df9f61d 100644 --- a/lib/fileset/internal.nix +++ b/lib/fileset/internal.nix @@ -179,7 +179,7 @@ rec { ${context} is of type ${typeOf value}, but it should be a file set or a path instead.'' else if ! pathExists value then throw '' - ${context} (${toString value}) does not exist.'' + ${context} (${toString value}) is a path that does not exist.'' else _singleton value; @@ -208,9 +208,9 @@ rec { if firstWithBase != null && differentIndex != null then throw '' ${functionContext}: Filesystem roots are not the same: - ${(head list).context}: root "${toString firstBaseRoot}" - ${(elemAt list differentIndex).context}: root "${toString (elemAt filesets differentIndex)._internalBaseRoot}" - Different roots are not supported.'' + ${(head list).context}: Filesystem root is "${toString firstBaseRoot}" + ${(elemAt list differentIndex).context}: Filesystem root is "${toString (elemAt filesets differentIndex)._internalBaseRoot}" + Different filesystem roots are not supported.'' else filesets; |