MediaWiki master
MediaWiki\Exception\MWExceptionRenderer Class Reference

Class to expose exceptions to the client (API bots, users, admins using CLI scripts) More...

Static Public Member Functions

static getHTML (Throwable $e)
 Format an HTML message for the given exception object.
 
static msg ( $key, $fallback,... $params)
 Get a message string from i18n.
 
static output (Throwable $e, $mode, ?Throwable $eNew=null)
 
static setShowExceptionDetails (bool $showDetails)
 
static shouldShowExceptionDetails ()
 

Public Attributes

const AS_PRETTY = 2
 
const AS_RAW = 1
 

Detailed Description

Class to expose exceptions to the client (API bots, users, admins using CLI scripts)

Since
1.28

Definition at line 46 of file MWExceptionRenderer.php.

Member Function Documentation

◆ getHTML()

static MediaWiki\Exception\MWExceptionRenderer::getHTML ( Throwable $e)
static

Format an HTML message for the given exception object.

Parameters
Throwable$e
Returns
string Html to output

Definition at line 223 of file MWExceptionRenderer.php.

◆ msg()

static MediaWiki\Exception\MWExceptionRenderer::msg ( $key,
$fallback,
$params )
static

Get a message string from i18n.

Parameters
string$keyMessage name
string$fallbackDefault message if the message cache can't be called by the exception @phpcs:ignore Generic.Files.LineLength
MessageParam|MessageSpecifier|string|int|float|list<MessageParam|MessageSpecifier|string|int|float>...$params See Message::params()
Returns
string Message with arguments replaced

Definition at line 260 of file MWExceptionRenderer.php.

References $fallback.

◆ output()

static MediaWiki\Exception\MWExceptionRenderer::output ( Throwable $e,
$mode,
?Throwable $eNew = null )
static
Parameters
Throwable$eOriginal exception
int$modeMWExceptionExposer::AS_* constant
Throwable | null$eNewNew throwable from attempting to show the first

Definition at line 82 of file MWExceptionRenderer.php.

Referenced by MediaWiki\Exception\ErrorPageError\report(), MediaWiki\Exception\MWException\report(), and MediaWiki\Exception\MWExceptionHandler\report().

◆ setShowExceptionDetails()

static MediaWiki\Exception\MWExceptionRenderer::setShowExceptionDetails ( bool $showDetails)
static
Parameters
bool$showDetails
Access: internal
For use by Setup.php and other internal use cases.

Definition at line 73 of file MWExceptionRenderer.php.

◆ shouldShowExceptionDetails()

static MediaWiki\Exception\MWExceptionRenderer::shouldShowExceptionDetails ( )
static
Access: internal
For use within core wiring only.
Returns
bool

Definition at line 65 of file MWExceptionRenderer.php.

Member Data Documentation

◆ AS_PRETTY

const MediaWiki\Exception\MWExceptionRenderer::AS_PRETTY = 2

◆ AS_RAW

const MediaWiki\Exception\MWExceptionRenderer::AS_RAW = 1

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