Module:Fail: Difference between revisions

(Created page with "-- Raise an error unconditionally. Potentially useful for debugging complex -- template logic. local Fail = {} function Fail.fail(frame) assert(false, 'A script error was triggered on purpose') end return Fail")
 
(add fail_multiline)
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
-- Raise an error unconditionally. Potentially useful for debugging complex
-- template logic.
local Fail = {}
local Fail = {}


function Fail.fail(frame)
function Fail.fail(frame)
assert(false, 'A script error was triggered on purpose')
assert(false, 'A script error was triggered on purpose')
end
function Fail.fail_multiline(frame)
assert(false, 'A script error was triggered on purpose.\n\nA script error was triggered on purpose.')
end
end


return Fail
return Fail

Latest revision as of 17:33, 9 January 2024

Raise an error unconditionally. Potentially useful for debugging complex template logic.


local Fail = {}

function Fail.fail(frame)
	assert(false, 'A script error was triggered on purpose')
end

function Fail.fail_multiline(frame)
	assert(false, 'A script error was triggered on purpose.\n\nA script error was triggered on purpose.')
end

return Fail