Skip to content

Commit 9ffe7eb

Browse files
issue/24043: add better exception handling for cli commands
1 parent 582d278 commit 9ffe7eb

File tree

1 file changed

+5
-1
lines changed
  • lib/internal/Magento/Framework/Console

1 file changed

+5
-1
lines changed

lib/internal/Magento/Framework/Console/Cli.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,11 @@ public function __construct($name = 'UNKNOWN', $version = 'UNKNOWN')
102102
*/
103103
public function doRun(Console\Input\InputInterface $input, Console\Output\OutputInterface $output)
104104
{
105-
$exitCode = parent::doRun($input, $output);
105+
try {
106+
$exitCode = parent::doRun($input, $output);
107+
} catch (\Exception $e) {
108+
$output->writeln($e->getTraceAsString());
109+
}
106110

107111
if ($this->initException) {
108112
throw $this->initException;

0 commit comments

Comments
 (0)