diff --git a/src/Client.php b/src/Client.php index 9822709..730b0c8 100644 --- a/src/Client.php +++ b/src/Client.php @@ -65,9 +65,12 @@ public function run(Request $request) : Response $info = (array) \curl_getinfo($handle); } if ($body === false) { + $error = \curl_error($handle); + $errno = \curl_errno($handle); + @\curl_close($handle); throw new RequestException( - \curl_error($handle), - \curl_errno($handle), + $error, + $errno, info: $info ); }