X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2FRest%2FResponseFactory.php;h=5e5a19852d8a6c3f8a1e876c0145ff04711c6b76;hb=f97d13a10c1b7dac7c4463c3ccc75e21a731c7a2;hp=d18cdb5d6bbe90c3ca3176cd8d97e64ff7fa7884;hpb=a6a6c19c794619c24881d2d984dc18ceb3b6419b;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/Rest/ResponseFactory.php b/includes/Rest/ResponseFactory.php index d18cdb5d6b..5e5a19852d 100644 --- a/includes/Rest/ResponseFactory.php +++ b/includes/Rest/ResponseFactory.php @@ -175,8 +175,13 @@ class ResponseFactory { public function createFromException( $exception ) { if ( $exception instanceof HttpException ) { // FIXME can HttpException represent 2xx or 3xx responses? - $response = $this->createHttpError( $exception->getCode(), - [ 'message' => $exception->getMessage() ] ); + $response = $this->createHttpError( + $exception->getCode(), + array_merge( + [ 'message' => $exception->getMessage() ], + (array)$exception->getErrorData() + ) + ); } else { $response = $this->createHttpError( 500, [ 'message' => 'Error: exception of type ' . get_class( $exception ),