From 7f0a0857c01344bd52fa90f57c8eb190a2a13d30 Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Mon, 16 Apr 2012 16:01:33 +0200 Subject: [PATCH] Catch PharException as well in self-update failures --- src/Composer/Command/SelfUpdateCommand.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Composer/Command/SelfUpdateCommand.php b/src/Composer/Command/SelfUpdateCommand.php index 28efe3a9f..f741beeca 100644 --- a/src/Composer/Command/SelfUpdateCommand.php +++ b/src/Composer/Command/SelfUpdateCommand.php @@ -59,7 +59,10 @@ EOT // 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('The download is corrupt ('.$e->getMessage().').'); $output->writeln('Please re-run the self-update command to try again.');