MediaWiki master
MWException Class Reference

MediaWiki exception. More...

Inherits Exception.

Inherited by ApiUsageException, ErrorPageError, FatalError, HttpError, MWContentSerializationException, and MediaWiki\Installer\InstallException.

Collaboration diagram for MWException:

Public Member Functions

 hasOverriddenHandler ()
 
 isLoggable ()
 Whether to log this exception in the exception debug log.
 
 msg ( $key, $fallback,... $params)
 Get a message from i18n.
 
 report ()
 Output a report about the exception and takes care of formatting.
 
 useMessageCache ()
 Can the extension use the Message class/wfMessage to get i18n-ed messages?
 

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.

Stability: newable
Stability: stable
to extend
Deprecated
since 1.40, use native exceptions instead (either directly, or defining subclasses when appropriate)

Definition at line 30 of file MWException.php.

Member Function Documentation

◆ hasOverriddenHandler()

MWException::hasOverriddenHandler ( )
final
Access: internal

Definition at line 103 of file MWException.php.

◆ isCommandLine()

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 113 of file MWException.php.

References MW_ENTRY_POINT.

◆ isLoggable()

MWException::isLoggable ( )

Whether to log this exception in the exception debug log.

Stability: stable
to override
Since
1.23
Returns
bool

Reimplemented in HttpError.

Definition at line 40 of file MWException.php.

◆ msg()

MWException::msg ( $key,
$fallback,
$params )

Get a message from i18n.

Parameters
string$keyMessage name
string$fallbackDefault message if the message cache can't be called by the exception
mixed...$params To pass to wfMessage()
Returns
string Message with arguments replaced

Definition at line 69 of file MWException.php.

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

Referenced by ErrorPageError\__construct(), ErrorPageError\getMessageObject(), ErrorPageError\report(), and UserNotLoggedIn\report().

◆ report()

MWException::report ( )

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

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

Stability: stable
to override

Reimplemented in HttpError.

Definition at line 95 of file MWException.php.

◆ useMessageCache()

MWException::useMessageCache ( )

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

Stability: stable
to override
Returns
bool

Definition at line 51 of file MWException.php.

Referenced by msg().


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