Module:Utils: Difference between revisions

From Halopedia, the Halo wiki

No edit summary
No edit summary
Line 2: Line 2:


function utils.error( ... )
function utils.error( ... )
return mw.dumpObject( ... )
end --[=[
-- Collect necessary information to display error
-- Collect necessary information to display error
local message = select( 1, ... ) or 'There was an error with a template. Are the parameters all correct?'
local args = select( 'args', ... )
local etype = select( 2, ... ) or 'Template'
local message = args[1] or 'There was an error with a template. Are the parameters all correct?'
local category = select( 3, ... ) or 'Pages containing template errors'
local etype = args[2] or 'Template'
local template = select( 4, ... ) or nil
local category = args[3] or 'Pages containing template errors'
local template = args[4] or nil
-- Add a warning to the edit preview
-- Add a warning to the edit preview
if template == nil then
if template == nil then
Line 24: Line 23:
.. ']]'
.. ']]'
end
end
]=]
 
return utils
return utils