| Index: trunk/phase3/includes/Exception.php |
| — | — | @@ -283,6 +283,8 @@ |
| 284 | 284 | * Report an exception to the user |
| 285 | 285 | */ |
| 286 | 286 | function wfReportException( Exception $e ) { |
| | 287 | + global $wgShowExceptionDetails; |
| | 288 | + |
| 287 | 289 | $cmdLine = MWException::isCommandLine(); |
| 288 | 290 | if ( $e instanceof MWException ) { |
| 289 | 291 | try { |
| — | — | @@ -292,11 +294,14 @@ |
| 293 | 295 | // Show a simpler error message for the original exception, |
| 294 | 296 | // don't try to invoke report() |
| 295 | 297 | $message = "MediaWiki internal error.\n\n"; |
| 296 | | - if ( $GLOBALS['wgShowExceptionDetails'] ) |
| 297 | | - $message .= "Original exception: " . $e->__toString(); |
| 298 | | - $message .= "\n\nException caught inside exception handler"; |
| 299 | | - if ( $GLOBALS['wgShowExceptionDetails'] ) |
| 300 | | - $message .= ": " . $e2->__toString(); |
| | 298 | + if ( $wgShowExceptionDetails ) { |
| | 299 | + $message .= 'Original exception: ' . $e->__toString() . "\n\n" . |
| | 300 | + 'Exception caught inside exception handler: ' . $e2->__toString(); |
| | 301 | + } else { |
| | 302 | + $message .= "Exception caught inside exception handler.\n\n" . |
| | 303 | + "Set \$wgShowExceptionDetails = true; at the bottom of LocalSettings.php " . |
| | 304 | + "to show detailed debugging information."; |
| | 305 | + } |
| 301 | 306 | $message .= "\n"; |
| 302 | 307 | if ( $cmdLine ) { |
| 303 | 308 | wfPrintError( $message ); |
| — | — | @@ -307,7 +312,7 @@ |
| 308 | 313 | } else { |
| 309 | 314 | $message = "Unexpected non-MediaWiki exception encountered, of type \"" . get_class( $e ) . "\"\n" . |
| 310 | 315 | $e->__toString() . "\n"; |
| 311 | | - if ( $GLOBALS['wgShowExceptionDetails'] ) { |
| | 316 | + if ( $wgShowExceptionDetails ) { |
| 312 | 317 | $message .= "\n" . $e->getTraceAsString() ."\n"; |
| 313 | 318 | } |
| 314 | 319 | if ( $cmdLine ) { |