diff --git a/src/Delivery/NovaPoshtaApi2.php b/src/Delivery/NovaPoshtaApi2.php index d56035d..19c7a41 100644 --- a/src/Delivery/NovaPoshtaApi2.php +++ b/src/Delivery/NovaPoshtaApi2.php @@ -289,6 +289,15 @@ private function request($model, $method, $params = null) } $result = curl_exec($ch); + + if (curl_errno($ch)) { + $e = new \Exception(curl_error($ch), curl_errno($ch)); + + curl_close($ch); + + throw $e; + } + curl_close($ch); } } else {