| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
|
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. |
Sorry, something went wrong.
@cjihrig Agreed. But I think the reduction of error codes is also important. |
Sorry, something went wrong.
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".
Sorry, something went wrong.
|
@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. |
Sorry, something went wrong.
|
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. |
Sorry, something went wrong.
|
changing error codes is definitely server-Major and would require two TSC votes |
Sorry, something went wrong.
|
I haven't reviewed the code but I'm +1 on the change |
Sorry, something went wrong.
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.
Sorry, something went wrong.
|
Should this breaking change be documented somewhere, maybe the ERR_OUT_OF_RANGE should remain in doc/api/errors.md with a note saying it has been replaced, for those still expecting it? |
Sorry, something went wrong.
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!
Sorry, something went wrong.
@apapirovski Actually there are 5 places using ERR_VALUE_OUT_OF_RANGE and 9 places using ERR_OUT_OF_RANGE in lib We use ERR_VALUE_OUT_OF_RANGE instead of the other because the error message of ERR_VALUE_OUT_OF_RANGE is more detailed. It gives the expected range and received value in error message. In contrast, the ERR_OUT_OF_RANGE only gives the value name.
Yes, I will fix it : ) |
Sorry, something went wrong.
There are 5 total instances of ERR_VALUE_OUT_OF_RANGE, that is 5 total errors that throw that code. There are 37 instances of ERR_OUT_OF_RANGE, 28 in lib/fs.js alone.
The error message can be modified on ERR_OUT_OF_RANGE instead. That's the whole point of error codes. |
Sorry, something went wrong.
|
I would rather use the ERR_OUT_OF_RANGE code also. |
Sorry, something went wrong.
|
I think I’d prefer ERR_VALUE_OUT_OF_RANGE, just because it seems not too unlikely that at some point we might want to have something like ERR_INDEX_OUT_OF_RANGE as well? And even if not, the ERR_VALUE_OUT_OF_RANGE doesn’t have that value/index ambiguity in its name. 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 |
Sorry, something went wrong.
|
For ERR_INDEX_OUT_OF_RANGE, I would think we would want to just use ERR_OUT_OF_RANGE for both and just have the message say index is out of range or something. I'm not sure I see a benefit to using a unique error code for it. The benefit of changing ERR_VALUE_OUT_OF_RANGE > ERR_OUT_OF_RANGE is:
IMO the introduction of ERR_VALUE_OUT_OF_RANGE was an oversight anyway. We had ERR_OUT_OF_RANGE much longer. |
Sorry, something went wrong.
|
Pushed commit to address comment. Changes are:
|
Sorry, something went wrong.
|
Also, this could potentially land in two separate commits:
I don't know if it's worth it but something to consider? |
Sorry, something went wrong.
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?
Sorry, something went wrong.
There was a problem hiding this comment.
Should this go into the deprecations?
Sorry, something went wrong.
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. |
Sorry, something went wrong.
I don't think that's happening in this PR, is it? The meaning is still exactly the same, just with more insight. |
Sorry, something went wrong.
|
Rebased to resolve conflicts and fixed some broken tests. |
Sorry, something went wrong.
|
This needs another rebase. |
Sorry, something went wrong.
|
Rebased to resolve conflicts. |
Sorry, something went wrong.
Sorry, something went wrong.
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
|
Rebased again to resolve conflicts. |
Sorry, something went wrong.
Sorry, something went wrong.
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: #17648 Fixes: #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>
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>
| Back | FazBrowse Home | New Git URL |
There two similar error codes in lib: ERR_VALUE_OUT_OF_RANGE and ERR_OUT_OF_RANGE. This change is to:
Fix: #17603
Checklist
Affected core subsystem(s)