lib.customisation: fix error message when running in nix repl (#452573)

This commit is contained in:
Philip Taron
2025-10-22 02:06:47 +00:00
committed by GitHub

View File

@@ -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));