http://www.mediawiki.org/wiki/Special:Code/MediaWiki/70637

Revision: 70637
Author:   ialex
Date:     2010-08-07 18:32:39 +0000 (Sat, 07 Aug 2010)

Log Message:
-----------
Added a note to set $wgShowExceptionDetails = true; in LocalSettings.php to get 
details when encoutring an second exception in the exception handler

Modified Paths:
--------------
    trunk/phase3/includes/Exception.php

Modified: trunk/phase3/includes/Exception.php
===================================================================
--- trunk/phase3/includes/Exception.php 2010-08-07 17:41:51 UTC (rev 70636)
+++ trunk/phase3/includes/Exception.php 2010-08-07 18:32:39 UTC (rev 70637)
@@ -283,6 +283,8 @@
  * Report an exception to the user
  */
 function wfReportException( Exception $e ) {
+       global $wgShowExceptionDetails;
+
        $cmdLine = MWException::isCommandLine();
        if ( $e instanceof MWException ) {
                try {
@@ -292,11 +294,14 @@
                        // Show a simpler error message for the original 
exception,
                        // don't try to invoke report()
                        $message = "MediaWiki internal error.\n\n";
-                       if ( $GLOBALS['wgShowExceptionDetails'] )
-                               $message .= "Original exception: " . 
$e->__toString();
-                       $message .= "\n\nException caught inside exception 
handler";
-                       if ( $GLOBALS['wgShowExceptionDetails'] )
-                               $message .= ": " . $e2->__toString();
+                       if ( $wgShowExceptionDetails ) {
+                               $message .= 'Original exception: ' . 
$e->__toString() . "\n\n" .
+                                       'Exception caught inside exception 
handler: ' . $e2->__toString();
+                       } else {
+                               $message .= "Exception caught inside exception 
handler.\n\n" .
+                                       "Set \$wgShowExceptionDetails = true; 
at the bottom of LocalSettings.php " .
+                                       "to show detailed debugging 
information.";
+                       }
                        $message .= "\n";
                        if ( $cmdLine ) {
                                wfPrintError( $message );
@@ -307,7 +312,7 @@
        } else {
                $message = "Unexpected non-MediaWiki exception encountered, of 
type \"" . get_class( $e ) . "\"\n" .
                        $e->__toString() . "\n";
-               if ( $GLOBALS['wgShowExceptionDetails'] ) {
+               if ( $wgShowExceptionDetails ) {
                        $message .= "\n" . $e->getTraceAsString() ."\n";
                }
                if ( $cmdLine ) {



_______________________________________________
MediaWiki-CVS mailing list
MediaWiki-CVS@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to