diff --git a/src/Symfony/Bundle/FrameworkBundle/Command/CacheClearCommand.php b/src/Symfony/Bundle/FrameworkBundle/Command/CacheClearCommand.php index 861bf21962d75..f252014e266e6 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Command/CacheClearCommand.php +++ b/src/Symfony/Bundle/FrameworkBundle/Command/CacheClearCommand.php @@ -16,6 +16,7 @@ use Symfony\Component\Console\Output\OutputInterface; use Symfony\Component\Console\Style\SymfonyStyle; use Symfony\Component\EventDispatcher\EventDispatcher; +use Symfony\Component\Filesystem\Exception\IOException; use Symfony\Component\Filesystem\Filesystem; use Symfony\Component\HttpKernel\CacheClearer\CacheClearerInterface; use Symfony\Component\HttpKernel\KernelInterface; @@ -130,7 +131,11 @@ protected function execute(InputInterface $input, OutputInterface $output) $io->comment('Removing old cache directory...'); } - $this->filesystem->remove($oldCacheDir); + try { + $this->filesystem->remove($oldCacheDir); + } catch (IOException $e) { + $io->warning($e->getMessage()); + } if ($output->isVerbose()) { $io->comment('Finished');