Index: trunk/phase3/includes/Exception.php |
— | — | @@ -272,31 +272,33 @@ |
273 | 273 | */ |
274 | 274 | function wfReportException( Exception $e ) { |
275 | 275 | $cmdLine = MWException::isCommandLine(); |
276 | | - if ( $e instanceof MWException ) { |
277 | | - try { |
278 | | - $e->report(); |
279 | | - } catch ( Exception $e2 ) { |
280 | | - // Exception occurred from within exception handler |
281 | | - // Show a simpler error message for the original exception, |
282 | | - // don't try to invoke report() |
283 | | - $message = "MediaWiki internal error.\n\n" . |
284 | | - "Original exception: " . $e->__toString() . |
285 | | - "\n\nException caught inside exception handler: " . |
286 | | - $e2->__toString() . "\n"; |
287 | | - |
288 | | - if ( $cmdLine ) { |
289 | | - wfPrintError( $message ); |
290 | | - } else { |
291 | | - echo nl2br( htmlspecialchars( $message ) ). "\n"; |
292 | | - } |
293 | | - } |
294 | | - } else { |
295 | | - $message = "Unexpected non-MediaWiki exception encountered, of type \"" . get_class( $e ) . "\"\n" . |
296 | | - $e->__toString() . "\n"; |
297 | | - if ( $GLOBALS['wgShowExceptionDetails'] ) { |
298 | | - $message .= "\n" . $e->getTraceAsString() ."\n"; |
299 | | - } |
300 | | - if ( $cmdLine ) { |
| 276 | + if ( $e instanceof MWException ) { |
| 277 | + try { |
| 278 | + $e->report(); |
| 279 | + } catch ( Exception $e2 ) { |
| 280 | + // Exception occurred from within exception handler |
| 281 | + // Show a simpler error message for the original exception, |
| 282 | + // don't try to invoke report() |
| 283 | + $message = "MediaWiki internal error.\n\n"; |
| 284 | + if ( $GLOBALS['wgShowExceptionDetails'] ) |
| 285 | + $message .= "Original exception: " . $e->__toString(); |
| 286 | + $message .= "\n\nException caught inside exception handler"; |
| 287 | + if ( $GLOBALS['wgShowExceptionDetails'] ) |
| 288 | + $message .= ": " . $e2->__toString(); |
| 289 | + $message .= "\n"; |
| 290 | + if ( $cmdLine ) { |
| 291 | + wfPrintError( $message ); |
| 292 | + } else { |
| 293 | + echo nl2br( htmlspecialchars( $message ) ). "\n"; |
| 294 | + } |
| 295 | + } |
| 296 | + } else { |
| 297 | + $message = "Unexpected non-MediaWiki exception encountered, of type \"" . get_class( $e ) . "\"\n" . |
| 298 | + $e->__toString() . "\n"; |
| 299 | + if ( $GLOBALS['wgShowExceptionDetails'] ) { |
| 300 | + $message .= "\n" . $e->getTraceAsString() ."\n"; |
| 301 | + } |
| 302 | + if ( $cmdLine ) { |
301 | 303 | wfPrintError( $message ); |
302 | 304 | } else { |
303 | 305 | echo nl2br( htmlspecialchars( $message ) ). "\n"; |
Index: trunk/phase3/RELEASE-NOTES |
— | — | @@ -177,6 +177,7 @@ |
178 | 178 | * Special:PrefixIndex: Move table styling to shared.css, add CSS IDs to tables |
179 | 179 | use correct message 'allpagesprefix' for input form label, replace _ with ' ' |
180 | 180 | in next page link |
| 181 | +* (bug 17506) Exceptions within exceptions now respect $wgShowExceptionDetails |
181 | 182 | |
182 | 183 | == API changes in 1.15 == |
183 | 184 | * (bug 16858) Revamped list=deletedrevs to make listing deleted contributions |