Module:Error/doc: Difference between revisions

From Our World of Text Wiki
Jump to navigation Jump to search
(Added example code.)
(Fixed example code.)
Line 2: Line 2:


<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
local error = require('Module:Error')
local mw_error = require('Module:Error').error
error("Message")
return mw_error("Message")
error(("TypeWarning: %s"):format(warning), tag)
return mw_error(("TypeError: %s"):format(warning), tag)
</syntaxhighlight>
</syntaxhighlight>



Revision as of 13:41, 2 December 2024

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

local mw_error = require('Module:Error').error
return mw_error("Message")
return mw_error(("TypeError: %s"):format(warning), tag)

See also