diff options
author | Marc Weber <marco-oweber@gmx.de> | 2013-08-22 11:20:57 +0300 |
---|---|---|
committer | Evgeny Egorochkin <phreedom@yandex.ru> | 2013-08-22 11:20:57 +0300 |
commit | 7a7659844715241f8a05fc5d7a20c07f47463134 (patch) | |
tree | d49908b60e935dce2594af36fd92cb3b2ca3e771 /pkgs | |
parent | 52204af457c30781b09accc91c5d18d045d674ea (diff) | |
download | nixlib-7a7659844715241f8a05fc5d7a20c07f47463134.tar nixlib-7a7659844715241f8a05fc5d7a20c07f47463134.tar.gz nixlib-7a7659844715241f8a05fc5d7a20c07f47463134.tar.bz2 nixlib-7a7659844715241f8a05fc5d7a20c07f47463134.tar.lz nixlib-7a7659844715241f8a05fc5d7a20c07f47463134.tar.xz nixlib-7a7659844715241f8a05fc5d7a20c07f47463134.tar.zst nixlib-7a7659844715241f8a05fc5d7a20c07f47463134.zip |
Improve error messages.
Improve function name: ensureDefaultType: It runs the check function, so checkDefault is much easier to understand.
Diffstat (limited to 'pkgs')
-rw-r--r-- | pkgs/lib/options.nix | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/pkgs/lib/options.nix b/pkgs/lib/options.nix index f10b5831267d..a7d1a3483a08 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 ]; |