MediaWiki  1.34.0
ScribuntoException Class Reference

An exception class which represents an error in the script. More...

Inheritance diagram for ScribuntoException:
Collaboration diagram for ScribuntoException:

Public Member Functions

 __construct ( $messageName, $params=[])
 
 getMessageName ()
 
 getScriptTraceHtml ( $options=[])
 Get the backtrace as HTML, or false if there is none available. More...
 
 toStatus ()
 
- Public Member Functions inherited from MWException
 getHTML ()
 If $wgShowExceptionDetails is true, return a HTML message with a backtrace to the error, otherwise show a message to ask to set it to true to show that information. More...
 
 getPageTitle ()
 Return the title of the page when reporting this error in a HTTP response. More...
 
 getText ()
 Get the text to display when reporting the error on the command line. More...
 
 isLoggable ()
 Whether to log this exception in the exception debug log. More...
 
 msg ( $key, $fallback,... $params)
 Get a message from i18n. More...
 
 report ()
 Output a report about the exception and takes care of formatting. More...
 
 reportHTML ()
 Output the exception report using HTML. More...
 
 useMessageCache ()
 Can the extension use the Message class/wfMessage to get i18n-ed messages? More...
 
 useOutputPage ()
 Should the exception use $wgOut to output the error? More...
 

Public Attributes

array $messageArgs
 
string $messageName
 
array $params
 

Additional Inherited Members

- Static Public Member Functions inherited from MWException
static isCommandLine ()
 Check whether we are in command line mode or not to report the exception in the correct format. More...
 

Detailed Description

An exception class which represents an error in the script.

This does not normally abort the request, instead it is caught and shown to the user.

Definition at line 136 of file Common.php.

Constructor & Destructor Documentation

◆ __construct()

ScribuntoException::__construct (   $messageName,
  $params = [] 
)
Parameters
string$messageName
array$params

Definition at line 156 of file Common.php.

References $messageName, $params, Title\newFromText(), and wfMessage().

Member Function Documentation

◆ getMessageName()

ScribuntoException::getMessageName ( )

◆ getScriptTraceHtml()

ScribuntoException::getScriptTraceHtml (   $options = [])

Get the backtrace as HTML, or false if there is none available.

Parameters
array$options
Returns
bool|string

Reimplemented in Scribunto_LuaError.

Definition at line 206 of file Common.php.

Referenced by ScribuntoHooks\invokeHook(), ApiScribuntoConsole\runConsole(), and Scribunto_LuaCommonTest\testNonUtf8Errors().

◆ toStatus()

ScribuntoException::toStatus ( )

Definition at line 195 of file Common.php.

References $status, and StatusValue\newFatal().

Referenced by Scribunto_LuaModule\validate().

Member Data Documentation

◆ $messageArgs

array ScribuntoException::$messageArgs

Definition at line 145 of file Common.php.

◆ $messageName

string ScribuntoException::$messageName

Definition at line 140 of file Common.php.

Referenced by __construct(), and getMessageName().

◆ $params

array ScribuntoException::$params

Definition at line 150 of file Common.php.

Referenced by __construct().


The documentation for this class was generated from the following file: