Jump to content
Toggle menu
  • 12,3 E szócikkek
  • 21,5 E fájlok
  • 4 felhasználók
  • 63,9 E szerkesztések
SCWIKI
Toggle preferences menu
Toggle personal menu
Nem vagy bejelentkezve
Your IP address will be publicly visible if you make any edits.
A lap korábbi változatát látod, amilyen SyncBot (vitalap | szerkesztései) 2026. augusztus 27., 14:16-kor történt szerkesztése után volt. (Imported from starcitizen.tools (auto-sync, new page only))
(eltér) ← Régebbi változat | Aktuális változat (eltér) | Újabb változat→ (eltér)
Module documentation[view][edit][history][purge]
This documentation is transcluded from Modul:User error/doc. Changes can be proposed in the talk page.

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;