Skip to content

Commit c6ebf5b

Browse files
authored
Merge pull request #7 from tsvgos/curl-error-handling
Improve cURL error handling
2 parents 2b1779a + 6ad4de9 commit c6ebf5b

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/ECB.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,9 @@ private static function fetch(string $url): string
7373
return $data;
7474
}
7575

76+
$curl_error = curl_error($ch);
7677
curl_close($ch);
7778

78-
throw new ECBException(curl_error($ch), ECBException::DATA_DOWNLOAD_FAILED);
79+
throw new ECBException($curl_error, ECBException::DATA_DOWNLOAD_FAILED);
7980
}
8081
}

0 commit comments

Comments
 (0)