-
Notifications
You must be signed in to change notification settings - Fork 29.6k
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
doc: error
event is optionally emitted after .destroy()
#26589
Conversation
"optionally" makes it sound like it's an option chosen by the user, but this really means "emit an 'error' event if there is an error", right? Just a suggestion for improvement but not blocking this change. What is here is already an improvement over what's currently in the docs now. |
@Trott good catch! that's true, it's not about user to decide whether or not emit this event.
In this case even if you pass |
Working on #26638 I've realised that in some situations streams are not emitting |
`error` event on each kind of stream is optionally emitted when `.destroy()` method is called. It depends on `._destroy()` implementation. In default implementation this event will no be fired unless `error` parameter has been provided. It was already mentioned for `writable.destroy([error])`, so I just copied same sentence for the other streams.
cc @nodejs/streams |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Landed in 78162ad |
`error` event on each kind of stream is optionally emitted when `.destroy()` method is called. It depends on `._destroy()` implementation. In default implementation this event will no be fired unless `error` parameter has been provided. It was already mentioned for `writable.destroy([error])`, so I just copied same sentence for the other streams. PR-URL: #26589 Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
`error` event on each kind of stream is optionally emitted when `.destroy()` method is called. It depends on `._destroy()` implementation. In default implementation this event will no be fired unless `error` parameter has been provided. It was already mentioned for `writable.destroy([error])`, so I just copied same sentence for the other streams. PR-URL: nodejs#26589 Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
`error` event on each kind of stream is optionally emitted when `.destroy()` method is called. It depends on `._destroy()` implementation. In default implementation this event will no be fired unless `error` parameter has been provided. It was already mentioned for `writable.destroy([error])`, so I just copied same sentence for the other streams. PR-URL: #26589 Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
error
event on each kind of stream is optionally emitted when.destroy()
method is called. It depends on._destroy()
implementation. In default implementation this event will no be fired unlesserror
parameter has been provided.It was already mentioned for
writable.destroy([error])
, so I just copied same sentence for the other streams.Checklist