Module:Items/ComparisonTables: Difference between revisions

Use printError function
(_getCategoryTable: Fix skill cape classification for Superior Cape of Completion)
(Use printError function)
Line 28: Line 28:


if Shared.tableIsEmpty(itemList) then
if Shared.tableIsEmpty(itemList) then
return 'ERROR: you must select at least one item to get stats for[[Category:Pages with script errors]]'
return Shared.printError('You must select at least one item to get stats for')
end
end


Line 344: Line 344:


local itemList = {}
local itemList = {}
local errMsg = 'ERROR: Some items not found in database: [[Category:Pages with script errors]]'
local errMsg = 'Some items not found in database: '
local hasErr = false
local hasErr = false
for i, name in Shared.skpairs(itemNames) do
for i, name in Shared.skpairs(itemNames) do
Line 357: Line 357:


if hasErr then
if hasErr then
return errMsg
return Shared.printError(errMsg)
else
else
return p._getEquipmentTable(itemList, includeModifiers)
return p._getEquipmentTable(itemList, includeModifiers)
Line 473: Line 473:
else
else
if Constants.getEquipmentSlotID(category) == nil then
if Constants.getEquipmentSlotID(category) == nil then
return 'ERROR: Invalid option. Choose either an equipment slot, Potion, or Other[[Category:Pages with script errors]]'
return Shared.printError('Invalid option. Choose either an equipment slot, Potion, or Other')
end
end
isEquipment = true
isEquipment = true