diff --git a/src/OpenAi.php b/src/OpenAi.php index ffc7a99..ed38d98 100644 --- a/src/OpenAi.php +++ b/src/OpenAi.php @@ -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; }