-
Notifications
You must be signed in to change notification settings - Fork 29.7k
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
stream: throw invalid argument errors #31831
Conversation
92ac737
to
36172d3
Compare
75f4dd3
to
f334f94
Compare
Logic errors that do not depend on stream state should throw instead of invoke callback and emit error.
9f2b5ec
to
722975a
Compare
@lpinca: Updated per our discussion |
assert.throws(() => { | ||
zlib.gunzip(input); | ||
}, { | ||
name: 'TypeError' | ||
}); |
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.
attention here
abecd9f
to
93c4107
Compare
gunzip.on('error', common.expectsError({ | ||
name: 'TypeError' | ||
})); | ||
}); |
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.
attention here
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
Co-Authored-By: Luigi Pinca <luigipinca@gmail.com>
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
eslint-jest fails in CITGM:
|
CITGM failures does not seem related to this PR. |
CITGM (master) for comparison: https://ci.nodejs.org/view/Node.js-citgm/job/citgm-smoker/2281/ |
I think this can land given that the CITGM failures seems unrelated. @Trott I'd appreciate a second opinion before landing. |
Yes, I'd agree. Thanks for opening nodejs/citgm#785. |
Oh, wait, I agree that CITGM is not an obstacle. But it does still need a second TSC approval because it's semver-major. @nodejs/tsc |
Looks good to me and I've added my approval, so this can land. Might not be a bad idea to leave it open for 24 hours or so just to give people one more chance to take a look, but that's not strictly required. |
Landed in 1f20912 |
Logic errors that do not depend on stream state should throw instead of invoke callback and emit error.
Refs: #31818
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passes