From 7c491f706f350a4c1e3013c897b4790f5492bb7c Mon Sep 17 00:00:00 2001 From: nichenqin Date: Sat, 19 Oct 2024 09:56:09 +0800 Subject: [PATCH] fix: fix event handler --- packages/cqrs/src/event-bus.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/cqrs/src/event-bus.ts b/packages/cqrs/src/event-bus.ts index 4426cbe91..d2e68c1ef 100644 --- a/packages/cqrs/src/event-bus.ts +++ b/packages/cqrs/src/event-bus.ts @@ -21,8 +21,7 @@ export class EventBus implements IEventBus const eventId = this.getEventId(event) const handler = this.#handlers.get(eventId) if (!handler) { - const eventName = this.getEventName(event) - throw new EventHandlerNotFoundException(eventName) + return } this.publisher.publish(event) return handler.handle(event)