-
Notifications
You must be signed in to change notification settings - Fork 30.1k
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
In writable stream, should we always set state.errorEmitted
to true when executing stream.emit('error')
?
#18181
Comments
@MoonBall as a Node.js user, it means nothing. Internally it is used in some checks (in Making the change you propose is hard, but if you want to take a stab at it I will be happy review it. |
if it only work in |
It is not just Ideally all of that should not be needed, would you like to investigate? |
ok. I try to do it. |
I think this should be closed. |
I have read the source code of
lib/_stream_writable.js
. I have a doubt about the meaning ofstate.errorEmitted
.Why do we set
state.errorEmitted
to true in some situations ofstream.emit('error')
, but doesn't set it in other situations. Moreover, it doesn't achieve emitting 'error' event only one time. For example, as shown below, the code will emit 'error' event two times :The text was updated successfully, but these errors were encountered: