summaryrefslogtreecommitdiff
path: root/includes/Exception.php
diff options
context:
space:
mode:
Diffstat (limited to 'includes/Exception.php')
-rw-r--r--includes/Exception.php11
1 files changed, 10 insertions, 1 deletions
diff --git a/includes/Exception.php b/includes/Exception.php
index 74820204..ab25f0b8 100644
--- a/includes/Exception.php
+++ b/includes/Exception.php
@@ -274,7 +274,16 @@ function wfReportException( Exception $e ) {
}
}
} else {
- echo $e->__toString();
+ $message = "Unexpected non-MediaWiki exception encountered, of type \"" . get_class( $e ) . "\"\n" .
+ $e->__toString() . "\n";
+ if ( $GLOBALS['wgShowExceptionDetails'] ) {
+ $message .= "\n" . $e->getTraceAsString() ."\n";
+ }
+ if ( !empty( $GLOBALS['wgCommandLineMode'] ) ) {
+ wfPrintError( $message );
+ } else {
+ echo nl2br( htmlspecialchars( $message ) ). "\n";
+ }
}
}