Open
Description
You have this at the CoursePutController.ts#L20:
try {
await this.commandBus.dispatch(createCourseCommand);
} catch (error) {
if (error instanceof CourseAlreadyExists) {
res.status(httpStatus.BAD_REQUEST).send(error.message);
} else {
res.status(httpStatus.INTERNAL_SERVER_ERROR).json(error);
}
}
Right now this works because we are using an InMemoryCommandBus
implementation. But, if we change the CommandBus implementation to one where we cannot expect the execution of the code (for example if we store this command in Kafka for later consumption), the implementation of this controller wouldn't work at all (because the use case will never get executed in this request, and it will never throw).
Is this true? Thanks!
Metadata
Metadata
Assignees
Labels
No labels