MediaWiki  master
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. More...
 
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 34 of file MWExceptionRenderer.php.

Member Function Documentation

◆ getHTML()

static 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 209 of file MWExceptionRenderer.php.

References MWExceptionHandler\getLogMessage(), MWExceptionHandler\getRedactedTraceAsString(), WebRequest\getRequestId(), and MWExceptionHandler\getURL().

Referenced by MediaWiki\run().

◆ output()

static 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 69 of file MWExceptionRenderer.php.

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

Referenced by MWExceptionHandler\report().

◆ setShowExceptionDetails()

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

Definition at line 60 of file MWExceptionRenderer.php.

◆ shouldShowExceptionDetails()

static MWExceptionRenderer::shouldShowExceptionDetails ( )
static

Member Data Documentation

◆ AS_PRETTY

const MWExceptionRenderer::AS_PRETTY = 2

Definition at line 36 of file MWExceptionRenderer.php.

Referenced by MWExceptionHandler\report().

◆ AS_RAW

const MWExceptionRenderer::AS_RAW = 1

Definition at line 35 of file MWExceptionRenderer.php.

Referenced by MWExceptionHandler\report().


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