From a44cfb70b1a99cc91692fd4d32ef51c59a898be7 Mon Sep 17 00:00:00 2001 From: as2252258 Date: Fri, 29 Apr 2022 16:43:54 +0800 Subject: [PATCH] modify mysql result --- EventDispatch.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/EventDispatch.php b/EventDispatch.php index a3ac012..5c6c3e1 100644 --- a/EventDispatch.php +++ b/EventDispatch.php @@ -39,7 +39,11 @@ class EventDispatch extends Component implements EventDispatcherInterface $lists = $this->eventProvider->getListenersForEvent($event); foreach ($lists as $listener) { /** @var Struct $list */ - $listener($event); + try { + $listener($event); + }catch (\Throwable $exception) { + $this->logger->addError($exception); + } if ($event instanceof StoppableEventInterface && $event->isPropagationStopped()) { break; }