about summary refs log tree commit diff
path: root/pkgs/lib
diff options
context:
space:
mode:
authorMarc Weber <marco-oweber@gmx.de>2013-08-22 11:20:57 +0300
committerEvgeny Egorochkin <phreedom@yandex.ru>2013-08-22 11:20:57 +0300
commit7a7659844715241f8a05fc5d7a20c07f47463134 (patch)
treed49908b60e935dce2594af36fd92cb3b2ca3e771 /pkgs/lib
parent52204af457c30781b09accc91c5d18d045d674ea (diff)
Improve error messages.
Improve function name: ensureDefaultType: It runs the check function, so
checkDefault is much easier to understand.
Diffstat (limited to 'pkgs/lib')
-rw-r--r--pkgs/lib/options.nix8
1 files changed, 4 insertions, 4 deletions
diff --git a/pkgs/lib/options.nix b/pkgs/lib/options.nix
index f10b5831267dd..a7d1a3483a08c 100644
--- a/pkgs/lib/options.nix
+++ b/pkgs/lib/options.nix
@@ -66,18 +66,18 @@ rec {
               if all opt.check list then
                 opt.merge list
               else
-                throw "One of the definitions has a bad type.";
+                throw "One of option ${name} values is of a bad type.";
           }
         else opt;
 
-      ensureDefaultType = opt:
+      checkDefault = opt:
         if opt ? check && opt ? default then
           opt // {
             default =
               if opt.check opt.default then
                 opt.default
               else
-                throw "The default value has a bad type.";
+                throw "The default value of option ${name} is of a bad type.";
           }
         else opt;
 
@@ -136,7 +136,7 @@ rec {
 
         # override settings
         ensureMergeInputType
-        ensureDefaultType
+        checkDefault
         handleOptionSets
       ];