Module:ISO 3166: Difference between revisions

Added error codes
No edit summary
(Added error codes)
Line 130:
then
if code2=="" then
return cerror(eot,"Invalid ISO 3166-1 code "..code1,orig),'[[Category:Wikipedia page with obscure country]]'
else
return cerror(eot,"Invalid ISO 3166-2 code "..code1.."-"..code2,orig),'[[Category:Wikipedia page with obscure country or subdivision]]'
end
end
Line 144:
or (data[code1]["displayname"] or data[code1]["name"])
else
return cerror(eot,"Unknown ISO 3166-1 code "..code1,orig),'[[Category:Wikipedia page with obscure country]]'
end
else
Line 152:
sdata = mw.loadData("Module:ISO 3166/data/"..code1)
else
return cerror(eot,"Unknown ISO 3166-1 code "..code1,orig),'[[Category:Wikipedia page with obscure country]]'
end
if sdata[code2] then
Line 175:
end
end
return cerror(eot,"Unknown ISO 3166-1 code "..code1,orig),'[[Category:Wikipedia page with obscure country]]'
end
Line 213:
end
end
return cerror(eot,"Unknown country name "..args[1],args[1]),'[[Category:Wikipedia page with obscure country]]'
else
--3166-2 code
Line 229:
end
if empty then
return cerror(eot,"No subdivision codes for "..args[1],args[2]),'[[Category:Wikipedia page with obscure subdivision]]'
else
return cerror(eot,"Unknown subdivision name "..args[2],args[2]),'[[Category:Wikipedia page with obscure subdivision]]'
end
end
end
return cerror(eot,"Unknown country name "..args[1],args[2]),'[[Category:Wikipedia page with obscure country]]'
end
Anonymous user