self::getShowBacktraceError( $e );
}
$message .= "\n";
+ } elseif ( $wgShowExceptionDetails ) {
+ $message = MWExceptionHandler::getLogMessage( $e ) .
+ "\nBacktrace:\n" .
+ MWExceptionHandler::getRedactedTraceAsString( $e ) . "\n";
} else {
- if ( $wgShowExceptionDetails ) {
- $message = MWExceptionHandler::getLogMessage( $e ) .
- "\nBacktrace:\n" .
- MWExceptionHandler::getRedactedTraceAsString( $e ) . "\n";
- } else {
- $message = MWExceptionHandler::getPublicLogMessage( $e );
- }
+ $message = MWExceptionHandler::getPublicLogMessage( $e );
}
echo nl2br( htmlspecialchars( $message ) ) . "\n";
}
* @param string $key Message name
* @param string $fallback Default message if the message cache can't be
* called by the exception
- * The function also has other parameters that are arguments for the message
+ * @param mixed ...$params To pass to wfMessage()
* @return string Message with arguments replaced
*/
- private static function msg( $key, $fallback /*[, params...] */ ) {
+ private static function msg( $key, $fallback, ...$params ) {
global $wgSitename;
- $args = array_slice( func_get_args(), 2 );
// FIXME: Keep logic in sync with MWException::msg.
try {
- $res = wfMessage( $key, $args )->text();
+ $res = wfMessage( $key, $params )->text();
} catch ( Exception $e ) {
- $res = wfMsgReplaceArgs( $fallback, $args );
+ $res = wfMsgReplaceArgs( $fallback, $params );
// If an exception happens inside message rendering,
// {{SITENAME}} sometimes won't be replaced.
$res = strtr( $res, [