Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Http/GuzzleHttpClient.php
Original file line numberDiff line numberDiff line change
Expand Up@@ -467,7 +467,7 @@ private function buildApiException(

if (!$parsedEnvelope) {
// HTTP layer succeeded, body is unparseable as APIError.
$message = 'failed to parse error response';
$message = sprintf('failed to parse error response: unexpected server response code %d', $statusCode);
}

if ($statusCode === 429) {
Expand Down
2 changes: 1 addition & 1 deletion tests/Exceptions/ErrorHandlingTest.php
Original file line numberDiff line numberDiff line change
Expand Up@@ -106,7 +106,7 @@ public function unparseableErrorResponseFallsBackToSentinelMessage(): void
self::assertSame(500, $e->getStatusCode());
self::assertSame(500, $e->getCode(), 'getCode() returns HTTP status (back-compat)');
self::assertSame(0, $e->getApiErrorCode(), 'APIError.code is 0 on unparseable body');
self::assertSame('failed to parse error response', $e->getMessage());
self::assertSame('failed to parse error response: unexpected server response code 500', $e->getMessage());
self::assertSame('<<<not json>>>', $e->getRawResponseBody());
self::assertNotNull($e->getPrevious(), 'cause chain must point to the JSON parse error');
self::assertInstanceOf(\JsonException::class, $e->getPrevious());
Expand Down
Loading