diff --git a/src/command-bus.ts b/src/command-bus.ts index 1f5f95bd..4d0d0347 100644 --- a/src/command-bus.ts +++ b/src/command-bus.ts @@ -58,7 +58,9 @@ export class CommandBus const commandId = this.getCommandId(command); const handler = this.handlers.get(commandId); if (!handler) { - throw new CommandHandlerNotFoundException(commandId); + throw new CommandHandlerNotFoundException( + Object.getPrototypeOf(command).constructor.name, + ); } this._publisher.publish(command); return handler.execute(command);