Slightly improve option type error messages
This commit is contained in:
parent
0ec10c57df
commit
6de7886fb8
|
@ -11,10 +11,7 @@ with import ./properties.nix;
|
|||
|
||||
rec {
|
||||
|
||||
inherit (lib) isType;
|
||||
|
||||
|
||||
isOption = isType "option";
|
||||
isOption = lib.isType "option";
|
||||
mkOption = attrs: attrs // {
|
||||
_type = "option";
|
||||
# name (this is the name of the attributem it is automatically generated by the traversal)
|
||||
|
@ -66,7 +63,7 @@ rec {
|
|||
if all opt.check list then
|
||||
opt.merge list
|
||||
else
|
||||
throw "One of option ${name} values has a bad type.";
|
||||
throw "A value of the option `${name}' has a bad type.";
|
||||
}
|
||||
else opt;
|
||||
|
||||
|
@ -77,7 +74,7 @@ rec {
|
|||
if opt.check opt.default then
|
||||
opt.default
|
||||
else
|
||||
throw "The default value of option ${name} has a bad type.";
|
||||
throw "The default value of the option `${name}' has a bad type.";
|
||||
}
|
||||
else opt;
|
||||
|
||||
|
|
Loading…
Reference in New Issue