Module:Error/sandbox: Difference between revisions

Content deleted Content added
Created page with '-- This module implements {{error}}. local p = {} local HtmlBuilder = require('Module:HtmlBuilder') local function _error(args) -- sandbox: move arg logic...'
 
sync
Line 6:
 
local function _error(args)
local message = args.message or args[1] or error('no message specified', 2)
-- sandbox: move arg logic together here
-- If the message parameter is present but blank, change it to nil so that Lua will
-- consider it false.
if args.message == "" then
args.message = nil
end
-- sandbox: remove internal error message
local message = args.message or args[1]
message = tostring(message)
local tag = mw.ustring.lower(tostring(args.tag))
Line 41 ⟶ 34:
-- the args are passed in directly.
args = frame
end
-- Ifif the message parameter is present but blank, change it to nil so that Lua will
-- consider it false.
if args.message == "" then
args.message = nil
end
return _error(args)