diff --git a/src/Composer/Util/Http/CurlDownloader.php b/src/Composer/Util/Http/CurlDownloader.php index 5fe3a86fc..22386e0e1 100644 --- a/src/Composer/Util/Http/CurlDownloader.php +++ b/src/Composer/Util/Http/CurlDownloader.php @@ -299,7 +299,10 @@ class CurlDownloader try { // TODO progress if (CURLE_OK !== $errno || $error) { - throw new TransportException('curl error while downloading '.Url::sanitize($progress['url']).': '.($error ?: '#'.$errno)); + if (!$error && function_exists('curl_strerror')) { + $error = curl_strerror($errno); + } + throw new TransportException('curl error '.$errno.' while downloading '.Url::sanitize($progress['url']).': '.$error); } $statusCode = $progress['http_code'];