This changes the current:
> Internal error.
To be:
> [
89466ede] 2015-09-23 16:40: Fatal exception of type Less_Exception
This matches how exceptions are reported on HTML pages by MediaWiki
(via MWException::getHTML in OutputPage).
The IDs are okay to be public and exposed on HTML pages even when
$wgShowExceptionDetails is disabled.
Follows-up
d478ffde100. Ref T110659.
Change-Id: I501eaa629161184ba89d44e53cdac20b39cb0903
return "[$id] $url $type from line $line of $file: $message";
}
+ public static function getPublicLogMessage( Exception $e ) {
+ $logId = self::getLogId( $e );
+ $type = get_class( $e );
+ return '[' . $logId . '] '
+ . gmdate( 'Y-m-d H:i:s' ) . ': '
+ . 'Fatal exception of type ' . $type;
+ }
+
/**
* Get a PSR-3 log event context from an Exception.
*
global $wgShowExceptionDetails;
if ( !$wgShowExceptionDetails ) {
- return 'Internal error';
+ return MWExceptionHandler::getPublicLogMessage( $e );
}
- return $e->__toString();
+ return MWExceptionHandler::getLogMessage( $e );
}
/**