Skip to content

Commit

Permalink
Make sendRequest throw Exception containing curl_error if response is…
Browse files Browse the repository at this point in the history
… false
  • Loading branch information
dougkulak committed Aug 7, 2023
1 parent 003d3b7 commit cede6e1
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 cede6e1

Please sign in to comment.