diff --git a/src/File/Loader.php b/src/File/Loader.php index af29b944..f90be595 100644 --- a/src/File/Loader.php +++ b/src/File/Loader.php @@ -236,11 +236,17 @@ protected function readRemoteFileWithCurl() $errorMessage = 'curl_exec() failed.'; } $errorCode = curl_errno($curl); - curl_close($curl); + if (PHP_VERSION_ID < 80000) { + curl_close($curl); + } + throw new RuntimeException($errorMessage, $errorCode); } $responseInfo = curl_getinfo($curl); - curl_close($curl); + if (PHP_VERSION_ID < 80000) { + curl_close($curl); + } + if ($responseInfo['http_code'] == 404) { throw new NotFoundException(sprintf('File %s does not exist.', $this->path)); }