Module:LuaError

From The Wiki Camp 2 Jr.
Revision as of 19:54, 29 April 2024 by Coppersalts (talk | contribs) (gonna try out that thing FallingPinapples did a while ago)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Documentation for this module may be created at Module:LuaError/doc

local p = {}

function p.luaerror(message, depth)
	if (type(message) == "table") then
		frame = message
		message = mw.text.unstripNoWiki(frame.args[1])
		depth = tonumber(frame.args[2])
	end
	if (depth == nil) then
		depth = 0
	end
	if (depth == 0) then
		error(message, 0)
	end
    p.luaerror(message, depth - 1)
end

return p