Avoid swallowing exceptions

main
Jordi Boggiano 4 years ago
parent 5b5a8da6bb
commit 742c2a9e93
No known key found for this signature in database
GPG Key ID: 7BBD42C429EC80BC

@ -212,12 +212,14 @@ EOT
$io->write(sprintf("Upgrading to version <info>%s</info> (%s channel).", $updateVersion, $channelString));
$remoteFilename = $baseUrl . ($updatingToTag ? "/download/{$updateVersion}/composer.phar" : '/composer.phar');
$signature = null;
try {
$signature = $httpDownloader->get($remoteFilename.'.sig')->getBody();
} catch (TransportException $e) {
if ($e->getStatusCode() === 404) {
throw new \InvalidArgumentException('Version "'.$updateVersion.'" could not be found.', 0, $e);
}
throw $e;
}
$io->writeError(' ', false);
$httpDownloader->copy($remoteFilename, $tempFilename);

Loading…
Cancel
Save