MediaWiki master
MediaWiki\Exception\HttpError Class Reference

Show an error that looks like an HTTP server error. More...

Inherits MediaWiki\Exception\MWException.

Collaboration diagram for MediaWiki\Exception\HttpError:

Public Member Functions

 __construct ( $httpCode, $content, $header=null)
 
 getHTML ()
 Returns HTML for reporting the HTTP error.
 
 getStatusCode ()
 Returns the HTTP status code supplied to the constructor.
 
 isLoggable ()
 We don't want the default exception logging as we got our own logging set up in self::report.
 
 report ()
 Report and log the HTTP error.
 
- Public Member Functions inherited from MediaWiki\Exception\MWException
 hasOverriddenHandler ()
 
 msg ( $key, $fallback,... $params)
 Get a message from i18n.
 
 useMessageCache ()
 Can the extension use the Message class/wfMessage to get i18n-ed messages?
 

Additional Inherited Members

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

Detailed Description

Show an error that looks like an HTTP server error.

Replacement for wfHttpError().

Stability: newable
Stability: stable
to extend
Since
1.19

Definition at line 36 of file HttpError.php.

Constructor & Destructor Documentation

◆ __construct()

MediaWiki\Exception\HttpError::__construct ( $httpCode,
$content,
$header = null )
Stability: stable
to call
Parameters
int$httpCodeHTTP status code to send to the client
string | Message$contentContent of the message
string | Message | null$headerContent of the header (\<title\> and \<h1\>)

Definition at line 52 of file HttpError.php.

Member Function Documentation

◆ getHTML()

MediaWiki\Exception\HttpError::getHTML ( )

Returns HTML for reporting the HTTP error.

This will be a minimal but complete HTML document.

Returns
string HTML

Definition at line 124 of file HttpError.php.

Referenced by MediaWiki\Exception\HttpError\report().

◆ getStatusCode()

MediaWiki\Exception\HttpError::getStatusCode ( )

Returns the HTTP status code supplied to the constructor.

Returns
int

Definition at line 77 of file HttpError.php.

◆ isLoggable()

MediaWiki\Exception\HttpError::isLoggable ( )

We don't want the default exception logging as we got our own logging set up in self::report.

See also
MWException::isLoggable
Since
1.24
Returns
bool

Reimplemented from MediaWiki\Exception\MWException.

Definition at line 68 of file HttpError.php.

◆ report()

MediaWiki\Exception\HttpError::report ( )

Report and log the HTTP error.

Sends the appropriate HTTP status code and outputs an HTML page with an error message.

Reimplemented from MediaWiki\Exception\MWException.

Definition at line 86 of file HttpError.php.

References MediaWiki\Exception\HttpError\getHTML().


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