Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Catch PharException as well in self-update failures

  • Loading branch information...
commit 7f0a0857c01344bd52fa90f57c8eb190a2a13d30 1 parent f0ac227
Jordi Boggiano Seldaek authored
Showing with 4 additions and 1 deletion.
  1. +4 −1 src/Composer/Command/SelfUpdateCommand.php
5 src/Composer/Command/SelfUpdateCommand.php
View
@@ -59,7 +59,10 @@ protected function execute(InputInterface $input, OutputInterface $output)
// free the variable to unlock the file
unset($phar);
rename($tempFilename, $localFilename);
- } catch (\UnexpectedValueException $e) {
+ } catch (\Exception $e) {
+ if (!$e instanceof \UnexpectedValueException && !$e instanceof \PharException) {
+ throw $e;
+ }
unlink($tempFilename);
$output->writeln('<error>The download is corrupt ('.$e->getMessage().').</error>');
$output->writeln('<error>Please re-run the self-update command to try again.</error>');
Please sign in to comment.
Something went wrong with that request. Please try again.