Skip to content

Commit f350d74

Browse files
Hide Swoole\ExitException trace message in command (#2953)
* Hide Swoole\ExitException trace message in command * Update CHANGELOG-2.0.md Co-authored-by: 李铭昕 <715557344@qq.com>
1 parent 3c9e632 commit f350d74

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

src/Command.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
use Hyperf\Utils\Coroutine;
1616
use Hyperf\Utils\Str;
1717
use Psr\EventDispatcher\EventDispatcherInterface;
18+
use Swoole\ExitException;
1819
use Symfony\Component\Console\Command\Command as SymfonyCommand;
1920
use Symfony\Component\Console\Formatter\OutputFormatterStyle;
2021
use Symfony\Component\Console\Helper\Table;
@@ -435,6 +436,8 @@ protected function execute(InputInterface $input, OutputInterface $output)
435436
$this->eventDispatcher && $this->eventDispatcher->dispatch(new Event\BeforeHandle($this));
436437
call([$this, 'handle']);
437438
$this->eventDispatcher && $this->eventDispatcher->dispatch(new Event\AfterHandle($this));
439+
} catch (ExitException $exception) {
440+
// Do nothing.
438441
} catch (\Throwable $exception) {
439442
if (! $this->eventDispatcher) {
440443
throw $exception;

0 commit comments

Comments
 (0)