diff options
author | Benoit Germain <bnt.germain@gmail.com> | 2018-11-26 09:20:38 +0100 |
---|---|---|
committer | Benoit Germain <bnt.germain@gmail.com> | 2018-11-26 09:20:38 +0100 |
commit | 7809a2c08bd3dbea49af2f19a24346372f219b5b (patch) | |
tree | 5e146d2d39ba7ae4414b4dc80cb6adb7ee5f3e03 /src | |
parent | 8d6500fe389624be422ee546f71a1efd4456eabe (diff) | |
download | lanes-7809a2c08bd3dbea49af2f19a24346372f219b5b.tar.gz lanes-7809a2c08bd3dbea49af2f19a24346372f219b5b.tar.bz2 lanes-7809a2c08bd3dbea49af2f19a24346372f219b5b.zip |
User-provided unknown configure option raises an error
Diffstat (limited to 'src')
-rw-r--r-- | src/lanes.lua | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/lanes.lua b/src/lanes.lua index 15908fa..bc47453 100644 --- a/src/lanes.lua +++ b/src/lanes.lua | |||
@@ -115,6 +115,12 @@ lanes.configure = function( settings_) | |||
115 | if type( settings_) ~= "table" then | 115 | if type( settings_) ~= "table" then |
116 | error "Bad parameter #1 to lanes.configure(), should be a table" | 116 | error "Bad parameter #1 to lanes.configure(), should be a table" |
117 | end | 117 | end |
118 | -- any setting unknown to Lanes raises an error | ||
119 | for setting, _ in pairs( settings_) do | ||
120 | if not param_checkers[setting] then | ||
121 | error( "Unknown parameter '" .. setting .. "' in configure options") | ||
122 | end | ||
123 | end | ||
118 | -- any setting not present in the provided parameters takes the default value | 124 | -- any setting not present in the provided parameters takes the default value |
119 | for key, checker in pairs( param_checkers) do | 125 | for key, checker in pairs( param_checkers) do |
120 | local my_param = settings_[key] | 126 | local my_param = settings_[key] |