1
0
Fork 0

Catch PharException as well in self-update failures

pull/588/head
Jordi Boggiano 2012-04-16 16:01:33 +02:00
parent f0ac227567
commit 7f0a0857c0
1 changed files with 4 additions and 1 deletions

View File

@ -59,7 +59,10 @@ EOT
// free the variable to unlock the file // free the variable to unlock the file
unset($phar); unset($phar);
rename($tempFilename, $localFilename); rename($tempFilename, $localFilename);
} catch (\UnexpectedValueException $e) { } catch (\Exception $e) {
if (!$e instanceof \UnexpectedValueException && !$e instanceof \PharException) {
throw $e;
}
unlink($tempFilename); unlink($tempFilename);
$output->writeln('<error>The download is corrupt ('.$e->getMessage().').</error>'); $output->writeln('<error>The download is corrupt ('.$e->getMessage().').</error>');
$output->writeln('<error>Please re-run the self-update command to try again.</error>'); $output->writeln('<error>Please re-run the self-update command to try again.</error>');