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

Event Emitter Exception Logging #1174

Open
1 task done
Jake13f opened this issue May 7, 2024 · 1 comment
Open
1 task done

Event Emitter Exception Logging #1174

Jake13f opened this issue May 7, 2024 · 1 comment

Comments

@Jake13f
Copy link

Jake13f commented May 7, 2024

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 any event listeners (ie @OnEvent("MY_EVENT")) default to suppressing exceptions. The default logger message when suppressing exceptions only prints the error message and ignores the stack if it exists. This causes it to be very tricky to trace where errors actually occurred.

Describe the solution you'd like

Print the stack trace if available when an exception occurs in an event listener. I believe the stack trace just needs added to the following line. https://github.com/nestjs/event-emitter/blob/master/lib/event-subscribers.loader.ts#L187

Teachability, documentation, adoption, migration strategy

No response

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

It is very difficult to track where an error originated without the stack trace.

@kamilmysliwiec
Copy link
Member

Would you like to create a PR for this issue?

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

No branches or pull requests

2 participants