MediaWiki  REL1_22
MWException Class Reference

MediaWiki exception. More...

Inheritance diagram for MWException:

List of all members.

Public Member Functions

 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.
 getLogId ()
 Get a the ID for this error.
 getLogMessage ()
 Return the requested URL and point to file and line number from which the exception occurred.
 getPageTitle ()
 Return the title of the page when reporting this error in a HTTP response.
 getText ()
 Get the text to display when reporting the error on the command line.
 isLoggable ()
 Whether to log this exception in the exception debug log.
 msg ($key, $fallback)
 Get a message from i18n.
 report ()
 Output a report about the exception and takes care of formatting.
 reportHTML ()
 Output the exception report using HTML.
 runHooks ($name, $args=array())
 Run hook to allow extensions to modify the text of the exception.
 useMessageCache ()
 Can the extension use the Message class/wfMessage to get i18n-ed messages?
 useOutputPage ()
 Should the exception use $wgOut to output the error?

Static Public Member Functions

static isCommandLine ()
 Check whether we are in command line mode or not to report the exception in the correct format.

Detailed Description

MediaWiki exception.

Definition at line 32 of file Exception.php.


Member Function Documentation

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.

Returns:
string html to output

Reimplemented in HttpError, FatalError, DBConnectionError, and DBError.

Definition at line 134 of file Exception.php.

References getLogId(), MWExceptionHandler\getLogMessage(), MWExceptionHandler\getRedactedTraceAsString(), and global.

Referenced by reportHTML(), and wfStreamThumb().

Get a the ID for this error.

Since:
1.20
Deprecated:
since 1.22 Use MWExceptionHandler::getLogId instead.
Returns:
string

Definition at line 187 of file Exception.php.

References wfDeprecated().

Referenced by getHTML().

Return the requested URL and point to file and line number from which the exception occurred.

Since:
1.8
Deprecated:
since 1.22 Use MWExceptionHandler::getLogMessage instead.
Returns:
string

Definition at line 200 of file Exception.php.

References wfDeprecated().

Referenced by getText().

Return the title of the page when reporting this error in a HTTP response.

Returns:
string

Reimplemented in DBQueryError, and DBConnectionError.

Definition at line 176 of file Exception.php.

References msg().

Referenced by reportHTML().

Get the text to display when reporting the error on the command line.

If $wgShowExceptionDetails is true, return a text message with a backtrace to the error.

Returns:
string

Reimplemented in FatalError, and DBError.

Definition at line 159 of file Exception.php.

References getLogMessage(), MWExceptionHandler\getRedactedTraceAsString(), and global.

Referenced by ChangePassword\execute(), CreateAndPromote\execute(), PPFuzzTester\execute(), report(), PublishStashedFileJob\run(), and AssembleUploadChunksJob\run().

static MWException::isCommandLine ( ) [static]

Check whether we are in command line mode or not to report the exception in the correct format.

Returns:
bool

Definition at line 269 of file Exception.php.

References empty.

Referenced by MWExceptionHandler\report().

Whether to log this exception in the exception debug log.

Since:
1.23
Returns:
boolean

Reimplemented in DBQueryError, and DBConnectionError.

Definition at line 52 of file Exception.php.

MWException::msg ( key,
fallback 
)

Get a message from i18n.

Parameters:
string$keymessage name
string$fallbackdefault message if the message cache can't be called by the exception The function also has other parameters that are arguments for the message
Returns:
string message with arguments replaced

Reimplemented in DBConnectionError.

Definition at line 117 of file Exception.php.

References $fallback, $key, useMessageCache(), wfMessage(), and wfMsgReplaceArgs().

Referenced by ErrorPageError\__construct(), getPageTitle(), and ErrorPageError\report().

Output a report about the exception and takes care of formatting.

It will be either HTML or plain text based on isCommandLine().

Reimplemented in HttpError, ThrottledError, PermissionsError, BadTitleError, and ErrorPageError.

Definition at line 243 of file Exception.php.

References getText(), global, MWExceptionHandler\logException(), MWExceptionHandler\printError(), reportHTML(), and wfHttpError().

Referenced by RunJobs\execute().

Output the exception report using HTML.

Reimplemented in DBConnectionError.

Definition at line 208 of file Exception.php.

References $wgOut, getHTML(), getPageTitle(), global, runHooks(), and useOutputPage().

Referenced by report().

MWException::runHooks ( name,
args = array() 
)

Run hook to allow extensions to modify the text of the exception.

Parameters:
string$nameclass name of the exception
array$argsarguments to pass to the callback functions
Returns:
string|null string to output or null if any hook has been called

Definition at line 80 of file Exception.php.

References $name, $result, array(), as, and global.

Referenced by reportHTML().

Can the extension use the Message class/wfMessage to get i18n-ed messages?

Returns:
bool

Definition at line 61 of file Exception.php.

References $wgLang, as, and global.

Referenced by msg(), and useOutputPage().

Should the exception use $wgOut to output the error?

Returns:
bool

Reimplemented in DBConnectionError.

Definition at line 39 of file Exception.php.

References empty, and useMessageCache().

Referenced by reportHTML().


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