self::printError( self::getText( $e ) );
} elseif ( $mode === self::AS_PRETTY ) {
self::statusHeader( 500 );
+ self::header( "Content-Type: $wgMimeType; charset=utf-8" );
if ( $e instanceof DBConnectionError ) {
self::reportOutageHTML( $e );
} else {
- self::header( "Content-Type: $wgMimeType; charset=utf-8" );
self::reportHTML( $e );
}
} else {
+ self::statusHeader( 500 );
+ self::header( "Content-Type: $wgMimeType; charset=utf-8" );
if ( $eNew ) {
$message = "MediaWiki internal error.\n\n";
if ( self::showBackTrace( $e ) ) {
* @param Exception|Throwable $e
*/
private static function reportOutageHTML( $e ) {
- global $wgShowDBErrorBacktrace, $wgShowHostnames, $wgShowSQLErrors;
+ global $wgShowDBErrorBacktrace, $wgShowHostnames, $wgShowSQLErrors, $wgSitename;
$sorry = htmlspecialchars( self::msg(
'dberr-problems',
}
MessageCache::singleton()->disable(); // no DB access
-
- $html = "<h1>$sorry</h1><p>$again</p><p><small>$info</small></p>";
+ $html = "<!DOCTYPE html>\n" .
+ '<html><head>' .
+ '<title>' .
+ htmlspecialchars( $wgSitename ) .
+ '</title>' .
+ '<style>body { font-family: sans-serif; margin: 0; padding: 0.5em 2em; }</style>' .
+ "</head><body><h1>$sorry</h1><p>$again</p><p><small>$info</small></p>";
if ( $wgShowDBErrorBacktrace ) {
$html .= '<p>Backtrace:</p><pre>' .
$html .= '<hr />';
$html .= self::googleSearchForm();
-
+ $html .= '</body></html>';
echo $html;
}