Skip to content

Commit

Permalink
[console] Use message_parser service to store messages. (#3587)
Browse files Browse the repository at this point in the history
  • Loading branch information
jmolivas authored Nov 14, 2017
1 parent 241fdc7 commit 8c14c1d
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion src/Bootstrap/Drupal.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
use Symfony\Component\Console\Input\ArrayInput;
use Symfony\Component\Console\Output\ConsoleOutput;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\DependencyInjection\Compiler\PassConfig;
use Drupal\Component\FileCache\FileCacheFactory;
use Drupal\Core\Site\Settings;
use Drupal\Console\Core\Style\DrupalStyle;
Expand Down Expand Up @@ -195,6 +194,22 @@ public function boot()
$container = $drupal->boot();
$container->set('class_loader', $this->autoload);

$notifyErrorCodes = [
0,
1045,
1049,
2002,
];

if (in_array($e->getCode(), $notifyErrorCodes)) {
$messageParser = $container->get('console.message_parser');
$messageParser->addMessage(
$container,
'error',
$e->getMessage()
);
}

return $container;
}
}
Expand Down

0 comments on commit 8c14c1d

Please sign in to comment.