(Created page with "-------------------------------------------------------------------------------- -- A less intimidating version of the built-in "error()" function, to help -- editors fix their mistakes when transcluding a template. -- -- @see wikia:w:c:Dev:Module:User error for a similar module. -------------------------------------------------------------------------------- local checkType = require("libraryUtil").checkType; return function (message, ...) checkType("Module:User...") |
m (1 revision imported: New Files) |
(No difference)
|
Latest revision as of 11:54, 24 March 2024
This documentation is transcluded from Module:User error/doc. Changes can be proposed in the talk page.
This module is unused.
This module is neither invoked by a template nor required/loaded by another module. If this is in error, make sure to add
{{Documentation}}
/{{No documentation}}
to the calling template's or parent's module documentation.A less intimidating version of the built-in error(...)
function, to help editors fix their mistakes when transcluding a template.
--------------------------------------------------------------------------------
-- A less intimidating version of the built-in "error()" function, to help
-- editors fix their mistakes when transcluding a template.
--
-- @see [[wikia:w:c:Dev:Module:User error]] for a similar module.
--------------------------------------------------------------------------------
local checkType = require("libraryUtil").checkType;
return function (message, ...)
checkType("Module:User error", 1, message, "string");
local result = mw.text.tag(
"strong",
{ class="error" },
"Error: " .. message
);
local categories = {};
for i = 1, select("#", ...) do
local category = select(i, ...);
checkType("Module:User error", 1 + i, category, "string", true);
if (category and category ~= "") then
table.insert(categories, "[[Category:" .. category .. "]]");
end
end
return result .. table.concat(categories);
end;