X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=src%2FWallabag%2FCoreBundle%2FCommand%2FInstallCommand.php;h=d9608246e47da188e496a5b7b6874987010cdc39;hb=7ab5eb9508921d84b4b4ec84a59135d536da748e;hp=0d9364f6aa4fb30a2c629f033126e254dbb5d722;hpb=4423b88c5b2c2d530b0a83a822f521a61ca4d4b8;p=github%2Fwallabag%2Fwallabag.git diff --git a/src/Wallabag/CoreBundle/Command/InstallCommand.php b/src/Wallabag/CoreBundle/Command/InstallCommand.php index 0d9364f6..d9608246 100644 --- a/src/Wallabag/CoreBundle/Command/InstallCommand.php +++ b/src/Wallabag/CoreBundle/Command/InstallCommand.php @@ -499,20 +499,18 @@ class InstallCommand extends ContainerAwareCommand $output = new BufferedOutput(); $exitCode = $this->getApplication()->run(new ArrayInput($parameters), $output); + // PDO does not always close the connection after Doctrine commands. + // See https://github.com/symfony/symfony/issues/11750. + $this->getContainer()->get('doctrine')->getManager()->getConnection()->close(); + if (0 !== $exitCode) { $this->getApplication()->setAutoExit(true); - $this->defaultOutput->writeln(''); - $this->defaultOutput->writeln('The command "'.$command.'" generates some errors: '); - $this->defaultOutput->writeln($output->fetch()); - - die(); + throw new \RuntimeException( + 'The command "'.$command."\" generates some errors: \n\n" + .$output->fetch()); } - // PDO does not always close the connection after Doctrine commands. - // See https://github.com/symfony/symfony/issues/11750. - $this->getContainer()->get('doctrine')->getManager()->getConnection()->close(); - return $this; }