For internal api error it is helpful for reporting when having the log
id under the exception was logged in the exception log.
Also use the redacted trace in the api error response instead of the
normal one to avoid leakage of function values if exception details are shown.
Change-Id: I7d917e532da1b1c7979a6599425f07d2f4f35aed
$errMessage = array(
'code' => 'internal_api_error_' . get_class( $e ),
- 'info' => $info,
+ 'info' => '[' . MWExceptionHandler::getLogId( $e ) . '] ' . $info,
);
ApiResult::setContent(
$errMessage,
- $config->get( 'ShowExceptionDetails' ) ? "\n\n{$e->getTraceAsString()}\n\n" : ''
+ $config->get( 'ShowExceptionDetails' )
+ ? "\n\n" . MWExceptionHandler::getRedactedTraceAsString( $e ) . "\n\n"
+ : ''
);
}