Uh oh!
There was an error while loading. Please reload this page.
lib: combine similar error codes - #17648
Conversation
cjihrig
commented
Dec 13, 2017
I'm not for or against this, but it definitely defeats the purpose of the error code movement. Theoretically, the idea is that the error message strings can change freely but the codes themselves will never change. |
starkwang
commented
Dec 13, 2017
@cjihrig Agreed. But I think the reduction of error codes is also important. |
TimothyGu
left a comment
There was a problem hiding this comment.
Not too happy about this either, but more "not happy about the fact that we have to do this" than "not happy about the fact that we are doing this".
BridgeAR
commented
Dec 13, 2017
@cjihrig as far as I see it there is still going to be some work about that but it is going to reduce a lot over time. |
BridgeAR
commented
Dec 13, 2017
I mark this as ready even though it should probably wait the full 48 hours and how do we handle error codes at the moment? Do we still require two TSC votes on it? I remember that we spoke about loosening that in Vancouver but I am not sure what happened afterwards about it. |
jasnell
commented
Dec 14, 2017
changing error codes is definitely server-Major and would require two TSC votes |
targos
commented
Dec 14, 2017
I haven't reviewed the code but I'm +1 on the change |
maclover7
left a comment
There was a problem hiding this comment.
+1, good to take care of these types of changes while new error codes are still being introduced, hopefully won't be too much ecosystem breakage.
maclover7
commented
Dec 14, 2017
Should this breaking change be documented somewhere, maybe the |
apapirovski
left a comment
There was a problem hiding this comment.
Can we use ERR_OUT_OF_RANGE instead going forward? There are 4 places currently that have ERR_VALUE_OUT_OF_RANGE compared to like 35 uses of the former.
Also, while at it, could you update to use RangeError everywhere instead of TypeError?
Thanks!
starkwang
commented
Dec 14, 2017
@apapirovski Actually there are 5 places using We use
Yes, I will fix it : ) |
There are 5 total instances of
The error message can be modified on |
jasnell
commented
Dec 14, 2017
I would rather use the |
I think I’d prefer Edit: Okay, in that case we might also want to call it “out of bounds”, not “out of range”… I still feel like that’s something that might be easy to mix up for non-native speakers of English |
4e412cf to
0e23879CompareFor The benefit of changing
IMO the introduction of |
starkwang
commented
Dec 14, 2017
Pushed commit to address comment. Changes are:
|
Also, this could potentially land in two separate commits:
I don't know if it's worth it but something to consider? |
There was a problem hiding this comment.
I wouldn't say discarded. Maybe just keep its description and say something like "Superseded by ERR_OUT_OF_RANGE." Maybe this should also somehow mention the Node.js version? I don't know... we don't have a policy around this right now, do we?
There was a problem hiding this comment.
Should this go into the deprecations?
Fishrock123
commented
Dec 14, 2017
I'm not sure about that. The purpose of the movement was to allow the messages to be semver-patch. Actually then changing the code-meaning of the error is still semver-major just as normal. |
apapirovski
commented
Dec 14, 2017
I don't think that's happening in this PR, is it? The meaning is still exactly the same, just with more insight. |
0e23879 to
aef3c65Compareaef3c65 to
94fdcc2Comparestarkwang
commented
Dec 19, 2017
Rebased to resolve conflicts and fixed some broken tests. |
BridgeAR
commented
Dec 21, 2017
This needs another rebase. |
94fdcc2 to
c0cd8daComparestarkwang
commented
Dec 21, 2017
Rebased to resolve conflicts. |
BridgeAR
commented
Dec 21, 2017
There two similar error codes in lib: "ERR_VALUE_OUT_OF_RANGE" and "ERR_OUT_OF_RANGE". This change is to reduce them into "ERR_VALUE_OUT_OF_RANGE" Fixes: nodejs#17603
c0cd8da to
05fe291Comparestarkwang
commented
Dec 23, 2017
Rebased again to resolve conflicts. |
joyeecheung
commented
Dec 23, 2017
There two similar error codes in lib: "ERR_VALUE_OUT_OF_RANGE" and "ERR_OUT_OF_RANGE". This change is to reduce them into "ERR_VALUE_OUT_OF_RANGE" Fixes: #17603 PR-URL: #17648Fixes: #17603 Reviewed-By: Timothy Gu <timothygu99@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Jon Moss <me@jonathanmoss.me> Reviewed-By: Anatoli Papirovski <apapirovski@mac.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
starkwang
commented
Dec 24, 2017
Landed in d022cb1 |
This removes two unused error codes: * ERR_STREAM_READ_NOT_IMPLEMENTED, removed in c979488 (PR nodejs#18813). * ERR_VALUE_OUT_OF_RANGE, removed in d022cb1 (PR nodejs#17648). PR-URL: nodejs#21491 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
This removes two unused error codes: * ERR_STREAM_READ_NOT_IMPLEMENTED, removed in c979488 (PR #18813). * ERR_VALUE_OUT_OF_RANGE, removed in d022cb1 (PR #17648). PR-URL: #21491 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
There two similar error codes in lib:
ERR_VALUE_OUT_OF_RANGEandERR_OUT_OF_RANGE. This change is to:ERR_VALUE_OUT_OF_RANGEFix: #17603
Checklist
make -j4 test(UNIX), orvcbuild test(Windows) passesAffected core subsystem(s)