lib.customisation: fix error message when running in nix repl (#452573)
This commit is contained in:
@@ -305,9 +305,10 @@ rec {
|
|||||||
arg:
|
arg:
|
||||||
let
|
let
|
||||||
loc = unsafeGetAttrPos arg fargs;
|
loc = unsafeGetAttrPos arg fargs;
|
||||||
|
loc' = if loc != null then loc.file + ":" + toString loc.line else "<unknown location>";
|
||||||
in
|
in
|
||||||
"Function called without required argument \"${arg}\" at "
|
"Function called without required argument \"${arg}\" at "
|
||||||
+ "${loc.file}:${toString loc.line}${prettySuggestions (getSuggestions arg)}";
|
+ "${loc'}${prettySuggestions (getSuggestions arg)}";
|
||||||
|
|
||||||
# Only show the error for the first missing argument
|
# Only show the error for the first missing argument
|
||||||
error = errorForArg (head (attrNames missingArgs));
|
error = errorForArg (head (attrNames missingArgs));
|
||||||
|
|||||||
Reference in New Issue
Block a user