feat: Improved error message for missing struct fields
This commit is contained in:
parent
4ebc069a3f
commit
ca0cf11ca9
2 changed files with 2 additions and 1 deletions
|
@ -35,6 +35,7 @@ with builtins; let
|
|||
type = def."${field}";
|
||||
checked = type.check fieldVal;
|
||||
in if checked then (current && true)
|
||||
else if isNull fieldVal then (throw "Missing required ${type.name} field '${field}'")
|
||||
else (throw "Field ${field} is of type ${typeOf fieldVal}, but expected ${type.name}");
|
||||
|
||||
checkExtraneous = name: def: present:
|
||||
|
|
BIN
z-structs.png
BIN
z-structs.png
Binary file not shown.
Before Width: | Height: | Size: 66 KiB After Width: | Height: | Size: 68 KiB |
Loading…
Reference in a new issue