-
Notifications
You must be signed in to change notification settings - Fork 30k
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
Clarify behaviour when listening for 'error' event using once() #31244
Comments
Its documented here: https://nodejs.org/api/events.html#events_error_events This issue isn't specific to the promisified methods. Perhaps every method that listens for an event needs to be linked to that section? Can you do a PR? |
@sam-github I don't understand your comment. The section of the documentation you linked does not mention the behavior of once() but the behavior of an EventEmitter. My issue is that when I read this:
I don't know what's going to happen when I listen for an
|
It is fulfilled if 'error' is emitted, ie the fulfilled handler will be called. The 2nd statement is ignored in this case. |
Can i work on this? |
Fixes: #31244 PR-URL: #34225 Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Anna Henningsen <[email protected]>
Fixes: #31244 PR-URL: #34225 Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Anna Henningsen <[email protected]>
Fixes: #31244 PR-URL: #34225 Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Anna Henningsen <[email protected]>
Fixes: #31244 PR-URL: #34225 Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Anna Henningsen <[email protected]>
The documentation for once states:
It's not clear from the documentation what happens when once is used to listen for
error
event. In my case this is the desired behaviors but I was surprised when my tests were not failing because an error event was emitted.This:
Prints:
Can you clarify this behaviour in the documentation please?
The text was updated successfully, but these errors were encountered: