FANDOM


-- <nowiki>
--------------------------------------------------------------------------------
-- A less intimidating version of the built-in "error()" function, to help
-- editors fix their mistakes when transcluding a template.
--------------------------------------------------------------------------------
local checkType = require('libraryUtil').checkType
 
return function (message, ...)
    checkType('Dev:User error', 1, message, 'string')
 
    local element = mw.html.create('strong')
        :addClass('error')
        :wikitext('Error: ' .. message .. '.')
 
    for i = 1, select('#', ...) do
        local category = select(i, ...)
 
        checkType('Dev:User error', i + 1, category, 'string')
 
        if category ~= '' then
            element:wikitext('[[Category:' .. category .. ']]')
        end
    end
 
    return tostring(element)
end
 
-- </nowiki>
-- (Add categories here.)
Community content is available under CC-BY-SA unless otherwise noted.

Fandom may earn an affiliate commission on sales made from links on this page.

Stream the best stories.

Fandom may earn an affiliate commission on sales made from links on this page.

Get Disney+