打开/关闭菜单
打开/关闭个人菜单
未登录
如果您进行任何编辑,您的IP地址会公开展示。

Module:User error

来自索尼克百科
Module 说明文档[查看][编辑][历史][刷新]
该说明文档嵌入自 Module:User error/doc,可通过讨论页面进行更改请求。

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;
我们提供服务需要使用Cookie。您使用我们的服务,即表示您同意我们使用Cookie。