diff --git a/src/ECB.php b/src/ECB.php index 6e6c87e..ca8b40c 100644 --- a/src/ECB.php +++ b/src/ECB.php @@ -73,8 +73,9 @@ private static function fetch(string $url): string return $data; } + $curl_error = curl_error($ch); curl_close($ch); - throw new ECBException(curl_error($ch), ECBException::DATA_DOWNLOAD_FAILED); + throw new ECBException($curl_error, ECBException::DATA_DOWNLOAD_FAILED); } }