-
-
Notifications
You must be signed in to change notification settings - Fork 272
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
Subscribe handlers should only return void
logged if using RpcException or RpcExceptionFilter
#683
Comments
@ttshivers Are you able to give us some hand on this one? @Nathan-Nesbitt What's the expected behavior? Would you be able to create a PR with the actual fix? |
I can tell you what the issue/fix might be. I tried setting up a global exception handler with NestJS. Each time I would trigger and catch any exception with it, a second log was printed from your library. (See the log above) For NestJS, seems The easiest fix is probably to remove the logging for that if you support NestJS exception handling. The better fix probably had to do with why it's returning |
This is the location, and it's repro-able using the basic implementation of the RPC exception handler from nestJS and your subscription setup. |
@Nathan-Nesbitt Thanks for all the information. |
@Nathan-Nesbitt This behavior seems to be intentional, looking at the code if a subscriber provides a response we acknowledge it. |
I've created the following using
@golevelup/nestjs-rabbitmq
as a demo of the issue:I get the following every time I handle an exception using the proposed
RpcException
handler by NestJS:On the other hand if you throw a standard error it doesn't appear to show up
Not sure how to narrow this down as I can only reproduce this when specific errors are thrown in the body of the subscribe handler. No matter what is done, this gets thrown if you use either
@Catch()
with andRpcExceptionFilter
or by throwing anRpcException
in the subscriber.The text was updated successfully, but these errors were encountered: