// removed.
$e->report();
} else {
- MWExceptionRenderer::output(
- $e, MWExceptionRenderer::AS_PRETTY );
+ MWExceptionRenderer::output( $e, MWExceptionRenderer::AS_PRETTY );
}
} catch ( Exception $e2 ) {
// Exception occurred from within exception handler
// Show a simpler message for the original exception,
// don't try to invoke report()
- MWExceptionRenderer::output( $e, MWExceptionRenderer::AS_PRETTY, $e2 );
+ MWExceptionRenderer::output( $e, MWExceptionRenderer::AS_RAW, $e2 );
}
}
public static function output( $e, $mode, $eNew = null ) {
global $wgMimeType;
- if ( $e instanceof DBConnectionError ) {
- self::reportOutageHTML( $e );
- return;
- }
-
if ( defined( 'MW_API' ) ) {
// Unhandled API exception, we can't be sure that format printer is alive
self::header( 'MediaWiki-API-Error: internal_api_error_' . get_class( $e ) );
} elseif ( self::isCommandLine() ) {
self::printError( self::getText( $e ) );
} elseif ( $mode === self::AS_PRETTY ) {
- self::statusHeader( 500 );
- self::header( "Content-Type: $wgMimeType; charset=utf-8" );
- self::reportHTML( $e );
+ if ( $e instanceof DBConnectionError ) {
+ self::reportOutageHTML( $e );
+ } else {
+ self::statusHeader( 500 );
+ self::header( "Content-Type: $wgMimeType; charset=utf-8" );
+ self::reportHTML( $e );
+ }
} else {
if ( $eNew ) {
$message = "MediaWiki internal error.\n\n";