Exception rendering fixes
[lhc/web/wiklou.git] / includes / exception / MWExceptionHandler.php
index 8359846..4a1f190 100644 (file)
@@ -62,12 +62,19 @@ class MWExceptionHandler {
        protected static function report( $e ) {
                try {
                        // Try and show the exception prettily, with the normal skin infrastructure
-                       MWExceptionRenderer::output( $e, MWExceptionRenderer::AS_PRETTY );
+                       if ( $e instanceof MWException ) {
+                               // Delegate to MWException until all subclasses are handled by
+                               // MWExceptionRenderer and MWException::report() has been
+                               // removed.
+                               $e->report();
+                       } else {
+                               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 );
                }
        }