Skip to content

Commit 034dc49

Browse files
author
Justinas Liubinskas
committed
curl error return if there was some http/s connection problem
1 parent 3f3193f commit 034dc49

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/MailerLite/Base/RestBase.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,10 @@ protected function doExecute(&$curlHandle)
148148
$this->setCurlOpts($curlHandle);
149149
$this->responseBody = curl_exec($curlHandle);
150150

151+
if ($this->responseBody === false) {
152+
$this->responseBody = 'CURL errno: '.curl_errno($curlHandle).', CURL error: '.curl_error($curlHandle);
153+
}
154+
151155
$this->responseInfo = curl_getinfo($curlHandle);
152156

153157
curl_close($curlHandle);

0 commit comments

Comments
 (0)