From 02f1fe67fb992c7883f9030cecdf7c3e29b2f8d6 Mon Sep 17 00:00:00 2001 From: Darren Felton Date: Wed, 17 Jan 2024 10:25:55 -0600 Subject: [PATCH 1/2] Call curl_errno instead of curl_error --- lib/Core/Connection.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/Core/Connection.php b/lib/Core/Connection.php index 4cddeff..a17025b 100644 --- a/lib/Core/Connection.php +++ b/lib/Core/Connection.php @@ -196,7 +196,7 @@ public function callApi($endpoint = null,$payload = '',$method = 'get',$type = ' $this->logger->error("Curl error: " . $error); } - $curlErrorNo = curl_error($this->curl); + $curlErrorNo = curl_errno($this->curl); if (empty($curlErrorNo) === false) { $this->logger->error("Curl errorNo: " . $curlErrorNo); @@ -339,4 +339,4 @@ protected function buildResponseHeaders($rawHeaders) return $headers; } -} \ No newline at end of file +} From 10efdb02299d09c5d3572e17af40a3fde9d9559b Mon Sep 17 00:00:00 2001 From: Darren Felton Date: Wed, 17 Jan 2024 10:28:53 -0600 Subject: [PATCH 2/2] Compare against CURLE_OK --- lib/Core/Connection.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Core/Connection.php b/lib/Core/Connection.php index a17025b..0bb63fc 100644 --- a/lib/Core/Connection.php +++ b/lib/Core/Connection.php @@ -198,7 +198,7 @@ public function callApi($endpoint = null,$payload = '',$method = 'get',$type = ' $curlErrorNo = curl_errno($this->curl); - if (empty($curlErrorNo) === false) { + if ($curlErrorNo !== CURLE_OK) { $this->logger->error("Curl errorNo: " . $curlErrorNo); }