Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
0.00% covered (danger)
0.00%
0 / 3
0.00% covered (danger)
0.00%
0 / 2
CRAP
0.00% covered (danger)
0.00%
0 / 1
FatalError
0.00% covered (danger)
0.00%
0 / 2
0.00% covered (danger)
0.00%
0 / 2
6
0.00% covered (danger)
0.00%
0 / 1
 getHTML
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 getText
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
1<?php
2/**
3 * @license GPL-2.0-or-later
4 * @file
5 */
6
7namespace MediaWiki\Exception;
8
9/**
10 * Abort the web request with a custom HTML string that will represent
11 * the entire response.
12 *
13 * This is not caught anywhere in MediaWiki code. It is handled through PHP's
14 * exception handler, which calls MWExceptionHandler::report.
15 *
16 * Unlike MWException, this will not provide error IDs or stack traces.
17 * It is intended for early installation and configuration problems where
18 * the exception is all the site administrator needs to know.
19 *
20 * @newable
21 * @stable to extend
22 * @since 1.7
23 * @ingroup Exception
24 */
25class FatalError extends MWException {
26
27    /**
28     * Replace our usual detailed HTML response for uncaught exceptions,
29     * with just the bare message as HTML.
30     *
31     * @return string
32     */
33    public function getHTML() {
34        return $this->getMessage();
35    }
36
37    /**
38     * @return string
39     */
40    public function getText() {
41        return $this->getMessage();
42    }
43}
44
45/** @deprecated class alias since 1.44 */
46class_alias( FatalError::class, 'FatalError' );