"ഘടകം:Wd" എന്ന താളിന്റെ പതിപ്പുകൾ തമ്മിലുള്ള വ്യത്യാസം

Content deleted Content added
(ചെ.) Changed protection level for "Module:Wd": High-risk Lua module: 5,000+ transclusions ([Edit=Require extended confirmed access] (indefinite))
imported>Pppery
Simplify and deduplicate error handling code
വരി 215:
return str
end
function errorText(code, param)
 
local error = i18n["errors"][error]
function unknownDataTypeError(dataType)
if param then error = applyStringPars(error, param) end
return applyStringParams(i18n['errors']['unknown-data-type'], dataType)
return error
end
function throwError(error, param)
 
error(errorText(param))
function missingRequiredParameterError()
return i18n['errors']['missing-required-parameter']
end
 
function extraRequiredParameterError(param)
return applyStringParams(i18n['errors']['extra-required-parameter'], param)
end
 
Line 585 ⟶ 581:
-- make sure that at least one required parameter has been defined
if not next(root.req) then
return i18n['errors'][' throwError("missing-required-parameter']")
error(missingRequiredParameterError())
end
-- make sure that the separator parameter "%s" is not amongst the required parameters
if root.req[parameters.separator] then
error(extraRequiredParameterErrorthrowError("extra-required-parameter", parameters.separator))
end
Line 1,219 ⟶ 1,215:
itemID = "P" .. itemID
else
return '<strong class="error">' .. unknownDataTypeErrorerrorText('unknown-data-type', snak.datatype) .. '</strong>'
end
Line 1,230 ⟶ 1,226:
return label
else
return '<strong class="error">' .. unknownDataTypeErrorerrorText('unknown-data-type', snak.datavalue.type) .. '</strong>'
end
elseif snak.snaktype == 'somevalue' and not noSpecial then
Line 2,531 ⟶ 2,527:
if not frame.args[1] then
errorthrowError(i18n["errors"]["no-function-specified"])
end
Line 2,537 ⟶ 2,533:
if f == "main" then
errorthrowError(i18n["errors"]["main-called-twice"])
end
assert(p["_"..f], applyStringParamserrorText(i18n['errors']['no-such-function'], f))
-- copy arguments from immutable to mutable table
"https://ml.wikipedia.org/wiki/ഘടകം:Wd" എന്ന താളിൽനിന്ന് ശേഖരിച്ചത്