Skip to content

Commit

Permalink
fix(bus): check for event handler existence (#39)
Browse files Browse the repository at this point in the history
fixes #19
  • Loading branch information
pmstss authored Apr 18, 2022
1 parent 28f49e9 commit 52db41e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/bus/src/dispatchers/RMQEventBus.ts
Original file line number Diff line number Diff line change
Expand Up @@ -237,11 +237,13 @@ export class RMQEventBus implements EventBus {
private resolveHandler<T, R>(
type: EventHandlerConstructor<T, R>
): EventHandler<T, R> {
if (!this.container.isRegistered(type)) {
const eventHandler = this.container.resolve(type);

if (!eventHandler) {
throw new EventHandlerNotFound(type.name);
}

return this.container.resolve(type);
return eventHandler;
}

private async expectReply<R>(
Expand Down

0 comments on commit 52db41e

Please sign in to comment.