1
0
Fork 0

Merge remote-tracking branch 'Serializator/reject-promise-on-exception-9424'

pull/9461/head
Jordi Boggiano 2020-11-11 14:35:08 +01:00
commit 4468248c46
No known key found for this signature in database
GPG Key ID: 7BBD42C429EC80BC
1 changed files with 8 additions and 4 deletions

View File

@ -268,10 +268,14 @@ class HttpDownloader
return;
}
if ($job['request']['copyTo']) {
$job['curl_id'] = $this->curl->download($resolve, $reject, $origin, $url, $options, $job['request']['copyTo']);
} else {
$job['curl_id'] = $this->curl->download($resolve, $reject, $origin, $url, $options);
try {
if ($job['request']['copyTo']) {
$job['curl_id'] = $this->curl->download($resolve, $reject, $origin, $url, $options, $job['request']['copyTo']);
} else {
$job['curl_id'] = $this->curl->download($resolve, $reject, $origin, $url, $options);
}
} catch (\Exception $exception) {
$reject($exception);
}
}