Skip to content

Commit

Permalink
fix: fix event handler
Browse files Browse the repository at this point in the history
  • Loading branch information
nichenqin committed Oct 19, 2024
1 parent 4b42997 commit 7c491f7
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions packages/cqrs/src/event-bus.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ export class EventBus<TEvent extends BaseEvent = BaseEvent> 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)
Expand Down

0 comments on commit 7c491f7

Please sign in to comment.