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