Skip to content

Commit fc0e961

Browse files
author
Marius
committed
Bulletproof handleResponse
1 parent 5bd1183 commit fc0e961

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/RequestBuilder.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ private function handleResponse(ResponseInterface $response): string
157157
}
158158

159159
throw new Exception(
160-
\strpos((string)$statusCode, '4') === 0 ? $contents : '{"message":"' . $contents . '"}',
160+
\strpos((string)$statusCode, '4') === 0 ? $contents : \json_encode(['message' => $contents]),
161161
$statusCode
162162
);
163163
}

0 commit comments

Comments
 (0)