X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fapi%2FApiErrorFormatter.php;h=5a52c5f143ff008367da37783eeb39009c2cbdfc;hb=33397ae8b6b46c367a5d94cd94f652be8f5940ef;hp=c637752dfb01ce9f286343f3bc07d4983c78dd1a;hpb=281e4b5f691b8738485d63d515fc0fef89a4ad79;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 ); }