Skip to content

Commit 19220fd

Browse files
committed
Replace JsonEncodingException
1 parent 81a8024 commit 19220fd

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/Contracts/Http.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public function delete(string $path, array $query = []);
4545

4646
/**
4747
* @throws ApiException
48-
* @throws JsonEncodingException
48+
* @throws \JsonException
4949
*/
5050
public function postStream(string $path, $body = null, array $query = []): StreamInterface;
5151
}

src/Http/Client.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ public function delete(string $path, array $query = [])
142142
* @throws ApiException
143143
* @throws ClientExceptionInterface
144144
* @throws CommunicationException
145-
* @throws JsonEncodingException
145+
* @throws \JsonException
146146
*/
147147
public function postStream(string $path, $body = null, array $query = []): StreamInterface
148148
{
@@ -197,7 +197,7 @@ private function executeStream(RequestInterface $request, array $headers = []):
197197
if ($this->isJSONResponse($response->getHeader('content-type'))) {
198198
try {
199199
$body = $this->json->unserialize($bodyContent) ?? $response->getReasonPhrase();
200-
} catch (JsonDecodingException $e) {
200+
} catch (\JsonException $e) {
201201
$body = '' !== $bodyContent ? $bodyContent : $response->getReasonPhrase();
202202
}
203203
} else {

0 commit comments

Comments
 (0)