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

View file

@ -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
];