Bật tắt bảng chọn
Bật tắt bảng chọn cá nhân
Chưa đăng nhập
Địa chỉ IP của bạn sẽ được hiển thị công khai nếu bạn thực hiện bất kỳ sửa đổi nào.

Khác biệt giữa bản sửa đổi của “Mô đun:User error”

Một thế giới nơi chỉ có đam mê, niềm vui và sắc màu...
starcitizen>Alistair3149
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..."
 
n Đã nhập 1 phiên bản: Cần thêm mô đun
 
(Không có sự khác biệt)

Bản mới nhất lúc 22:51, ngày 25 tháng 7 năm 2023

Có thể viết tài liệu về mô đun này tại Mô đun:User error/tài liệu.

--------------------------------------------------------------------------------
-- 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;
Cookies help us deliver our services. By using our services, you agree to our use of cookies.