Skip to content

Commit

Permalink
Merge pull request #102 from dougkulak/main
Browse files Browse the repository at this point in the history
Make sendRequest throw Exception containing curl_error if response is false
  • Loading branch information
orhanerday authored Oct 28, 2023
2 parents c9949b3 + cede6e1 commit 14ba818
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/OpenAi.php
Original file line number Diff line number Diff line change
Expand Up @@ -548,6 +548,8 @@ private function sendRequest(string $url, string $method, array $opts = [])

curl_close($curl);

if (!$response) throw new Exception(curl_error($curl));

return $response;
}

Expand Down

0 comments on commit 14ba818

Please sign in to comment.