Skip to content

Commit dabde02

Browse files
Merge pull request #5 from CodeWithKyrian/4-unhandled-exception-when-connecting-to-chromadb-if-its-not-running
Fix bug introduced in 0.2.0 while handling exceptions
2 parents 2beda44 + a932ad7 commit dabde02

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Generated/ChromaApiClient.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
use Codewithkyrian\ChromaDB\Generated\Responses\GetItemsResponse;
2222
use Codewithkyrian\ChromaDB\Generated\Responses\QueryItemsResponse;
2323
use GuzzleHttp\Client;
24-
use GuzzleHttp\Exception\ServerException;
24+
use GuzzleHttp\Exception\RequestException;
2525
use Psr\Http\Client\ClientExceptionInterface;
2626

2727
/**
@@ -318,7 +318,7 @@ public function reset(): bool
318318

319319
private function handleChromaApiException(\Exception|ClientExceptionInterface $e): void
320320
{
321-
if ($e instanceof ClientExceptionInterface) {
321+
if ($e instanceof RequestException) {
322322
$errorString = $e->getResponse()->getBody()->getContents();
323323

324324
if (preg_match('/(?<={"\"error\"\:\")([^"]*)/', $errorString, $matches)) {

0 commit comments

Comments
 (0)