about summary refs log tree commit diff
path: root/yants.nix
diff options
context:
space:
mode:
Diffstat (limited to 'yants.nix')
-rw-r--r--yants.nix3
1 files changed, 2 insertions, 1 deletions
diff --git a/yants.nix b/yants.nix
index 3dfebfcf1fa0..a00d084392d3 100644
--- a/yants.nix
+++ b/yants.nix
@@ -35,7 +35,8 @@ with builtins; let
       type = def."${field}";
       checked = type.check fieldVal;
   in if checked then (current && true)
-     else (throw "Field ${field} is of type ${typeOf fieldVal}, but expected ${type.name}");
+     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:
   if (length present) == 0 then true