1
0
Fork 0

Avoid swallowing exceptions

pull/9508/head
Jordi Boggiano 2020-11-19 09:50:35 +01:00
parent 5b5a8da6bb
commit 742c2a9e93
No known key found for this signature in database
GPG Key ID: 7BBD42C429EC80BC
1 changed files with 2 additions and 0 deletions

View File

@ -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);