File tree Expand file tree Collapse file tree 2 files changed +2
-9
lines changed
tests/unit/Providers/Http/Util Expand file tree Collapse file tree 2 files changed +2
-9
lines changed Original file line number Diff line number Diff line change @@ -50,13 +50,6 @@ public static function throwIfNotSuccessful(Response $response): void
5050
5151 // 4xx Client Errors
5252 if ($ statusCode >= 400 && $ statusCode < 500 ) {
53- // Special handling for 400 Bad Request
54- if ($ statusCode === 400 ) {
55- $ body = (string ) $ response ->getBody ();
56- $ errorDetail = $ body ? substr ($ body , 0 , 200 ) : 'Invalid request parameters ' ;
57- throw ClientException::fromBadRequestResponse ($ errorDetail );
58- }
59- // General 4xx client errors
6053 throw ClientException::fromClientError ($ response );
6154 }
6255
Original file line number Diff line number Diff line change @@ -57,11 +57,11 @@ public function testThrowIfNotSuccessfulThrowsClientExceptionFor400BadRequest():
5757 $ response = $ this ->createMock (Response::class);
5858 $ response ->method ('isSuccessful ' )->willReturn (false );
5959 $ response ->method ('getStatusCode ' )->willReturn (400 );
60- $ response ->method ('getBody ' )->willReturn ('' );
60+ $ response ->method ('getData ' )->willReturn ([] );
6161
6262 $ this ->expectException (ClientException::class);
6363 $ this ->expectExceptionCode (400 );
64- $ this ->expectExceptionMessage ('Bad request (400): Invalid request parameters ' );
64+ $ this ->expectExceptionMessage ('Client error (400): Request was rejected due to client-side issue ' );
6565
6666 ResponseUtil::throwIfNotSuccessful ($ response );
6767 }
You can’t perform that action at this time.
0 commit comments