]> git.immae.eu Git - github/wallabag/wallabag.git/blobdiff - src/Wallabag/CoreBundle/Command/InstallCommand.php
Isolated tests
[github/wallabag/wallabag.git] / src / Wallabag / CoreBundle / Command / InstallCommand.php
index 0d9364f6aa4fb30a2c629f033126e254dbb5d722..d9608246e47da188e496a5b7b6874987010cdc39 100644 (file)
@@ -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('<error>The command "'.$command.'" generates some errors: </error>');
-            $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;
     }