1
0
Fork 0

Improve curl error reporting some more

pull/9508/head
Jordi Boggiano 2020-11-18 21:36:33 +01:00
parent 852990d06c
commit 5248d6c9f1
No known key found for this signature in database
GPG Key ID: 7BBD42C429EC80BC
1 changed files with 4 additions and 1 deletions

View File

@ -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'];