X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fapi%2FApiErrorFormatter.php;h=5a52c5f143ff008367da37783eeb39009c2cbdfc;hb=6ff65e57bbf203a53a2f0232f76d55116e85d928;hp=c637752dfb01ce9f286343f3bc07d4983c78dd1a;hpb=f036c5b324e2b2d240edf8d5eeb7fc2af3d88c47;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/api/ApiErrorFormatter.php b/includes/api/ApiErrorFormatter.php index c637752dfb..5a52c5f143 100644 --- a/includes/api/ApiErrorFormatter.php +++ b/includes/api/ApiErrorFormatter.php @@ -164,16 +164,6 @@ class ApiErrorFormatter { $msg = Message::newFromSpecifier( $exception ); $params = []; } else { - // Extract code and data from the exception, if applicable - if ( $exception instanceof UsageException ) { - $data = $exception->getMessageArray(); - if ( !$options['code'] ) { - $options['code'] = $data['code']; - } - unset( $data['code'], $data['info'] ); - $options['data'] = array_merge( $data, $options['data'] ); - } - if ( isset( $options['wrap'] ) ) { $msg = $options['wrap']; } else { @@ -203,7 +193,7 @@ class ApiErrorFormatter { public function formatException( $exception, array $options = [] ) { return $this->formatMessage( $this->getMessageFromException( $exception, $options ), - isset( $options['format'] ) ? $options['format'] : null + $options['format'] ?? null ); }