Improve error messages.

Improve function name: ensureDefaultType: It runs the check function, so
checkDefault is much easier to understand.
This commit is contained in:
Marc Weber 2013-08-22 11:20:57 +03:00 committed by Evgeny Egorochkin
parent 52204af457
commit 7a76598447
1 changed files with 4 additions and 4 deletions

View File

@ -66,18 +66,18 @@ rec {
if all opt.check list then if all opt.check list then
opt.merge list opt.merge list
else else
throw "One of the definitions has a bad type."; throw "One of option ${name} values is of a bad type.";
} }
else opt; else opt;
ensureDefaultType = opt: checkDefault = opt:
if opt ? check && opt ? default then if opt ? check && opt ? default then
opt // { opt // {
default = default =
if opt.check opt.default then if opt.check opt.default then
opt.default opt.default
else else
throw "The default value has a bad type."; throw "The default value of option ${name} is of a bad type.";
} }
else opt; else opt;
@ -136,7 +136,7 @@ rec {
# override settings # override settings
ensureMergeInputType ensureMergeInputType
ensureDefaultType checkDefault
handleOptionSets handleOptionSets
]; ];