Merge "Introduce ExternalStoreFactory"
[lhc/web/wiklou.git] / includes / exception / MWException.php
index 4ff8636..c633431 100644 (file)
@@ -63,17 +63,6 @@ class MWException extends Exception {
                return $wgLang instanceof Language;
        }
 
-       /**
-        * Run hook to allow extensions to modify the text of the exception
-        *
-        * @param string $name Class name of the exception
-        * @param array $args Arguments to pass to the callback functions
-        * @return string|null String to output or null if any hook has been called
-        */
-       public function runHooks( $name, $args = [] ) {
-               return MWExceptionRenderer::runHooks( $this, $name, $args );
-       }
-
        /**
         * Get a message from i18n
         *
@@ -113,7 +102,7 @@ class MWException extends Exception {
                } else {
                        $logId = WebRequest::getRequestId();
                        $type = static::class;
-                       return "<div class=\"errorbox\">" .
+                       return Html::errorBox(
                        '[' . $logId . '] ' .
                        gmdate( 'Y-m-d H:i:s' ) . ": " .
                        $this->msg( "internalerror-fatal-exception",
@@ -121,7 +110,7 @@ class MWException extends Exception {
                                $type,
                                $logId,
                                MWExceptionHandler::getURL( $this )
-                       ) . "</div>\n" .
+                       ) ) .
                        "<!-- Set \$wgShowExceptionDetails = true; " .
                        "at the bottom of LocalSettings.php to show detailed " .
                        "debugging information. -->";
@@ -164,12 +153,7 @@ class MWException extends Exception {
                if ( $this->useOutputPage() ) {
                        $wgOut->prepareErrorPage( $this->getPageTitle() );
 
-                       $hookResult = $this->runHooks( static::class );
-                       if ( $hookResult ) {
-                               $wgOut->addHTML( $hookResult );
-                       } else {
-                               $wgOut->addHTML( $this->getHTML() );
-                       }
+                       $wgOut->addHTML( $this->getHTML() );
 
                        $wgOut->output();
                } else {
@@ -183,12 +167,7 @@ class MWException extends Exception {
                                '<style>body { font-family: sans-serif; margin: 0; padding: 0.5em 2em; }</style>' .
                                "</head><body>\n";
 
-                       $hookResult = $this->runHooks( static::class . 'Raw' );
-                       if ( $hookResult ) {
-                               echo $hookResult;
-                       } else {
-                               echo $this->getHTML();
-                       }
+                       echo $this->getHTML();
 
                        echo "</body></html>\n";
                }