lib.generators.toPretty: Add attribute name to error context

This commit is contained in:
Robert Hensing 2022-12-10 23:36:46 +01:00
parent 5fb20d2f8c
commit 1a44080088

View file

@ -342,7 +342,10 @@ rec {
else "{" + introSpace else "{" + introSpace
+ libStr.concatStringsSep introSpace (libAttr.mapAttrsToList + libStr.concatStringsSep introSpace (libAttr.mapAttrsToList
(name: value: (name: value:
"${libStr.escapeNixIdentifier name} = ${go (indent + " ") value};") v) "${libStr.escapeNixIdentifier name} = ${
builtins.addErrorContext "while evaluating an attribute `${name}`"
(go (indent + " ") value)
};") v)
+ outroSpace + "}" + outroSpace + "}"
else abort "generators.toPretty: should never happen (v = ${v})"; else abort "generators.toPretty: should never happen (v = ${v})";
in go ""; in go "";