X-Git-Url: http://www.aleph1.co.uk/gitweb/?a=blobdiff_plain;ds=sidebyside;f=vendor%2Fdrupal%2Fconsole-core%2Fsrc%2FEventSubscriber%2FCallCommandListener.php;fp=vendor%2Fdrupal%2Fconsole-core%2Fsrc%2FEventSubscriber%2FCallCommandListener.php;h=fe7c0754317400d85015652e261b90dda46ed6d6;hb=eba34333e3c89f208d2f72fa91351ad019a71583;hp=aead3164c12556814f7859c8ba3ebeedef153d6a;hpb=a2bd1bf0c2c1f1a17d188f4dc0726a45494cefae;p=yaffs-website diff --git a/vendor/drupal/console-core/src/EventSubscriber/CallCommandListener.php b/vendor/drupal/console-core/src/EventSubscriber/CallCommandListener.php index aead3164c..fe7c07543 100644 --- a/vendor/drupal/console-core/src/EventSubscriber/CallCommandListener.php +++ b/vendor/drupal/console-core/src/EventSubscriber/CallCommandListener.php @@ -17,6 +17,7 @@ use Drupal\Console\Core\Style\DrupalStyle; /** * Class CallCommandListener + * * @package Drupal\Console\Core\EventSubscriber */ class CallCommandListener implements EventSubscriberInterface @@ -28,6 +29,7 @@ class CallCommandListener implements EventSubscriberInterface /** * CallCommandListener constructor. + * * @param ChainQueue $chainQueue */ public function __construct(ChainQueue $chainQueue) @@ -46,14 +48,14 @@ class CallCommandListener implements EventSubscriberInterface $io = new DrupalStyle($event->getInput(), $event->getOutput()); if (!$command instanceof Command) { - return; + return 0; } $application = $command->getApplication(); $commands = $this->chainQueue->getCommands(); if (!$commands) { - return; + return 0; } foreach ($commands as $chainedCommand) { @@ -69,7 +71,15 @@ class CallCommandListener implements EventSubscriberInterface } $io->text($chainedCommand['name']); - $callCommand->run($input, $io); + $allowFailure = array_key_exists('allow_failure', $chainedCommand)?$chainedCommand['allow_failure']:false; + try { + $callCommand->run($input, $io); + } catch (\Exception $e) { + if (!$allowFailure) { + $io->error($e->getMessage()); + return 1; + } + } } }