-
Notifications
You must be signed in to change notification settings - Fork 42
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
Add OnSafeEvent #994
Comments
So you're basically proposing a no-op on errors for event handlers. What about adding a new option to the |
import { OnOptions } from 'eventemitter2';
export declare type OnEventOptions = OnOptions & {
prependListener?: boolean;
suppressErrors?: boolean;
}; is suppressErrors do the samething as i suggested? |
yes. I didn't know about that flag event-emitter/tests/e2e/module-e2e.spec.ts Lines 136 to 145 in 0c5b404
event-emitter/tests/src/events-provider.consumer.ts Lines 27 to 31 in 0c5b404
|
thank you, but, i cannot reproduce that behavior. or, somewhere in i've already make 'onSafeEvent' decorator in my project, but... should it needed? i think that if we wanna log eventHandler's exception , then use the custom decorator is fine. oh, i found PR #936 , the blogs is too old, thank you! |
@koreanddinghwan the docs is missing that feature as well feel free to open a PR to update it https://docs.nestjs.com/techniques/events |
got it, i'm not good at open-source contribute, and it will be the first time, but i'll gonna try it, thank you for your help! |
Is there an existing issue that is already proposing this?
Is your feature request related to a problem? Please describe it
OnEvent has problem with server stops.
Describe the solution you'd like
Teachability, documentation, adoption, migration strategy
No response
What is the motivation / use case for changing the behavior?
do not stop server when the exception not catched in OnEvent
The text was updated successfully, but these errors were encountered: