Skip to content

Commit

Permalink
Improve curl error reporting some more
Browse files Browse the repository at this point in the history
  • Loading branch information
Seldaek committed Nov 18, 2020
1 parent 852990d commit 5248d6c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/Composer/Util/Http/CurlDownloader.php
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,10 @@ public function tick()
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'];
Expand Down

0 comments on commit 5248d6c

Please sign in to comment.