-
Notifications
You must be signed in to change notification settings - Fork 29.8k
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
string_decoder: Migrate to use internal/errors #14682
Conversation
lib/string_decoder.js
Outdated
@@ -31,7 +32,7 @@ function normalizeEncoding(enc) { | |||
const nenc = internalUtil.normalizeEncoding(enc); | |||
if (typeof nenc !== 'string' && | |||
(Buffer.isEncoding === isEncoding || !Buffer.isEncoding(enc))) | |||
throw new Error(`Unknown encoding: ${enc}`); | |||
throw new errors.Error('ERR_UNKNOWN_ENCODING', enc); |
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.
As this is semver-major anyway it could probably be changed to a TypeError
ed34f34
to
660dc96
Compare
ping @nodejs/ctc, needs approval |
We ship this in Can we hold off until that is ready? I would prefer not having to revert too many commits before releasing 9 if that is not ready. cc @jasnell |
blocked until we have a modular solution for |
At the latest streams wg we decided to unblock this. We would like this (and the equals for Writable, Duplex and Transform) to ship in Node 9. |
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 if CI green.
Landed in eb4940e |
PR-URL: nodejs/node#14682 Refs: nodejs/node#11273 Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
PR-URL: nodejs/node#14682 Refs: nodejs/node#11273 Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Ref: #11273
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passesAffected core subsystem(s)
string_decoder