From b6bf8c1dd755fa18cdb39c6dea9f198297a6953c Mon Sep 17 00:00:00 2001 From: mbs-team <66429932+mbs-team@users.noreply.github.com> Date: Thu, 20 Jun 2024 10:54:42 +0200 Subject: [PATCH] Handle cURL errors --- src/FusionAuth/RESTClient.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/FusionAuth/RESTClient.php b/src/FusionAuth/RESTClient.php index 84f649e..152bdb3 100644 --- a/src/FusionAuth/RESTClient.php +++ b/src/FusionAuth/RESTClient.php @@ -251,6 +251,10 @@ public function go() $result = curl_exec($curl); + if (curl_errno($curl)) { + throw new \Exception(curl_error($curl), curl_errno($curl)); + } + $response->status = curl_getinfo($curl, CURLINFO_HTTP_CODE); if ($response->status < 200 || $response->status > 299) { if ($result) {