Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CommandHandleException with Command Name not command uuid #1491

Open
1 task done
Dracks opened this issue Sep 15, 2023 · 2 comments
Open
1 task done

CommandHandleException with Command Name not command uuid #1491

Dracks opened this issue Sep 15, 2023 · 2 comments
Labels

Comments

@Dracks
Copy link
Contributor

Dracks commented Sep 15, 2023

Is there an existing issue that is already proposing this?

  • I have searched the existing issues

Is your feature request related to a problem? Please describe it

Currently, we are having some random problems with the commandHandler that nestjs doesn't found the commandHandler, and this trigger the CommandHandlerException with an UUID, which makes it super dificult to debug.

Describe the solution you'd like

I would like that on the following line:
https://github.com/nestjs/cqrs/blob/master/src/command-bus.ts#L61

The name passed to the exception is the real name of the class, and not the ID. Currently I needed to go to the sourcecode in production, look at the line of the exception to search what command was failing.

Teachability, documentation, adoption, migration strategy

No response

What is the motivation / use case for changing the behavior?

Makes thinks easy to debug, I replicated a similar error here:
https://codesandbox.io/p/sandbox/exciting-wildflower-kqx3ky

And you can see the error is not really user friendly, If I had 4 or 5 commands, and after a refactor I get that error, It's not straight forward.

@Dracks Dracks added the feature label Sep 15, 2023
@kamilmysliwiec
Copy link
Member

Would you like to create a PR for this issue?

@Dracks
Copy link
Contributor Author

Dracks commented Sep 18, 2023

I will try it. Give me some time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants