Zum Inhalt springen

Modul:Protection banner: Unterschied zwischen den Versionen

make the category name function errors more descriptive
(fix category name function comments)
(make the category name function errors more descriptive)
Zeile 226: Zeile 226:
local propertiesKey = categoryOrder[i]
local propertiesKey = categoryOrder[i]
if not propertiesKey then
if not propertiesKey then
error('no properties key')
local msg = 'no entry found for key '
.. i
.. ' in the cfg.reasons.'
.. reason
.. '.categoryOrder table'
error(msg)
end
end
local property = properties[propertiesKey]
local property = properties[propertiesKey]
if not property then
if not property then
error('invalid properties key')
local msg = 'invalid value "'
.. propertiesKey
.. '" detected in the cfg.reasons.'
.. reason
.. '.categoryOrder table'
error(msg)
end
end
if dupes[property] then
if dupes[propertiesKey] then
error('dupe detected')
local msg = 'duplicate values "'
.. propertiesKey
.. '" detected in the cfg.reasons.'
.. reason
.. '.categoryOrder table'
error(msg)
else
else
dupes[property] = true
dupes[propertiesKey] = true
end
end
configOrder[i] = property
configOrder[i] = property
Zeile 246: Zeile 261:
local property = properties[categoryOrder]
local property = properties[categoryOrder]
if not property then
if not property then
error('invalid category order string')
local msg = '"'
.. categoryOrder
.. '" is not a valid value of cfg.reasons.'
.. reason
.. '.categoryOrder'
error(msg)
end
end
toTableEnd(configOrder, property.order)
toTableEnd(configOrder, property.order)
Zeile 327: Zeile 347:
end
end
end
end
error('No category match found; please define the category for key "all-all-all-all-all"')
error(
'No category match found;'
.. ' please define the category for key "all-all-all-all-all"'
)
end
end


Anonymer Benutzer