Skip to content

Commit 199838c

Browse files
committed
-
1 parent ee7262d commit 199838c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/Bridge/OpenAI/GPT/ResponseConverter.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
use Symfony\Component\HttpClient\Chunk\ServerSentEvent;
2020
use Symfony\Component\HttpClient\EventSourceHttpClient;
2121
use Symfony\Component\HttpClient\Exception\JsonException;
22+
use Symfony\Contracts\HttpClient\Exception\ClientExceptionInterface;
2223
use Symfony\Contracts\HttpClient\ResponseInterface as HttpResponse;
2324

2425
final class ResponseConverter implements PlatformResponseConverter
@@ -36,7 +37,7 @@ public function convert(HttpResponse $response, array $options = []): LlmRespons
3637

3738
try {
3839
$data = $response->toArray();
39-
} catch (\Throwable $e) {
40+
} catch (ClientExceptionInterface $e) {
4041
$data = $response->toArray(throw: false);
4142

4243
if (isset($data['error']['code']) && 'content_filter' === $data['error']['code']) {

0 commit comments

Comments
 (0)