From df96347d4761f2c9b9a522024c880b1fb520f04a Mon Sep 17 00:00:00 2001 From: Brad Jorsch Date: Mon, 29 Dec 2014 13:57:40 -0500 Subject: [PATCH] API: Clean up uncaught exception backtrace output The existing response seems to be designed to look good with format=xmlfm, which doesn't make much sense now that format=jsonfm is the default. Change-Id: Ic3993aaf7e401d6233bbbe4522e77004099e3c40 --- includes/api/ApiMain.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/includes/api/ApiMain.php b/includes/api/ApiMain.php index 99f90eea6e..15441890a8 100644 --- a/includes/api/ApiMain.php +++ b/includes/api/ApiMain.php @@ -712,12 +712,12 @@ class ApiMain extends ApiBase { 'code' => 'internal_api_error_' . get_class( $e ), 'info' => '[' . MWExceptionHandler::getLogId( $e ) . '] ' . $info, ); - ApiResult::setContent( - $errMessage, - $config->get( 'ShowExceptionDetails' ) - ? "\n\n" . MWExceptionHandler::getRedactedTraceAsString( $e ) . "\n\n" - : '' - ); + if ( $config->get( 'ShowExceptionDetails' ) ) { + ApiResult::setContent( + $errMessage, + MWExceptionHandler::getRedactedTraceAsString( $e ) + ); + } } // Remember all the warnings to re-add them later -- 2.20.1