Jump to content
 







Main menu
   


Navigation  



Main page
Contents
Current events
Random article
About Wikipedia
Contact us
Donate
 




Contribute  



Help
Learn to edit
Community portal
Recent changes
Upload file
 








Search  

































Create account

Log in
 









Create account
 Log in
 




Pages for logged out editors learn more  



Contributions
Talk
 



















Contents

   



(Top)
 


1 See also  














Module:Error






Afrikaans
Алтай тил
Аԥсшәа
العربية

Asturianu
Azərbaycanca
تۆرکجه
Basa Bali

 / Bân-lâm-gú
Башҡортса
Беларуская
Беларуская (тарашкевіца)

Bikol Central
Български
Bosanski
Brezhoneg
Català
Чӑвашла
Cebuano
Čeština
Chamoru
Chavacano de Zamboanga
Chi-Chewa
Corsu
Cymraeg
Dansk
الدارجة
ދިވެހިބަސް
Eesti
Esperanto
Euskara
Farefare
فارسی
Føroyskt
Frysk
Galego
ГӀалгӀай

گیلکی

  / Gõychi Konknni
/Hak-kâ-ngî

Hausa
Հայերեն
ि
Hrvatski
Ilokano
Bahasa Indonesia
Ирон
IsiXhosa
Íslenska
Jawa

Kapampangan

 / کٲشُر
Ikirundi
Kurdî
Ladin
Latviešu
Lietuvių
ि
Македонски

Malti
Māori


مصرى

مازِرونی
Bahasa Melayu
 / Mìng-dĕ̤ng-nḡ
Мокшень
Монгол

Na Vosa Vakaviti
Nederlands

Нохчийн
Norfuk / Pitkern
Norsk bokmål
Novial
ି
Oʻzbekcha / ўзбекча

ि
Pangasinan
پښتو
Polski
Português
Qaraqalpaqsha
Română
Русиньскый
Русский
Sakizaya


Scots
Seeltersk
Setswana
Shqip

Simple English
سنڌي
Slovenščina
کوردی
Српски / srpski
Sunda
Tagalog
ி
 


Тоҷикӣ

Türkçe
Удмурт
Українська
اردو
Tiếng Vit
Volapük
Walon

Winaray

Yorùbá


 

Edit links
 









Module
Talk
 

















Read
View source
View history
 








Tools
   


Actions  



Read
View source
View history
 




General  



What links here
Related changes
Upload file
Special pages
Permanent link
Page information
Get shortened URL
Download QR code
Wikidata item
 




Print/export  



Download as PDF
Printable version
 




In other projects  



Wikimedia Commons
MediaWiki
Meta-Wiki
Wikimedia Outreach
Wikispecies
Wikifunctions
Wikimania
Wikinews
Wikiquote
Wikisource
Wikiversity
 
















Appearance
   

 





Permanently protected module

From Wikipedia, the free encyclopedia
 


This module implements {{Error}}. It creates an html message with class "error". Please, see the documentation page there for usage instructions.

See also

-- This module implements {{error}}.

local p = {}

local function _error(args)
    local tag = mw.ustring.lower(tostring(args.tag))

    -- Work out what html tag we should use.
    if not (tag == 'p' or tag == 'span' or tag == 'div') then
        tag = 'strong'
    end

    -- Generate the html.
    return tostring(mw.html.create(tag)
        :addClass('error')
        :wikitext(tostring(args.message or args[1] or error('no message specified', 2)))
    )
end

function p.error(frame)
    local args
    if type(frame.args) == 'table' then
        -- We're being called via #invoke. The args are passed through to the module
        -- from the template page, so use the args that were passed into the template.
        args = frame.args
    else
        -- We're being called from another module or from the debug console, so assume
        -- the args are passed in directly.
        args = frame
    end
    -- 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
    return _error(args)
end

return p

Retrieved from "https://en.wikipedia.org/w/index.php?title=Module:Error&oldid=750709040"

Categories: 
Modules subject to page protection
Error-handling modules
Hidden category: 
Wikipedia template-protected modules
 



This page was last edited on 21 November 2016, at 11:11 (UTC).

Text is available under the Creative Commons Attribution-ShareAlike License 4.0; additional terms may apply. By using this site, you agree to the Terms of Use and Privacy Policy. Wikipedia® is a registered trademark of the Wikimedia Foundation, Inc., a non-profit organization.



Privacy policy

About Wikipedia

Disclaimers

Contact Wikipedia

Code of Conduct

Developers

Statistics

Cookie statement

Mobile view



Wikimedia Foundation
Powered by MediaWiki