-
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
errors: alter ERR_HTTP2_INVALID_CONNECTION_HEADERS #19807
Conversation
changes the base instance for ERR_HTTP2_INVALID_CONNECTION_HEADERS from Error to TypeError as a more accurate representation of the error.
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.
I guess no test is failing and it would be great if you could add a test in that case as well.
lib/internal/errors.js
Outdated
@@ -712,9 +712,8 @@ E('ERR_HTTP2_HEADER_SINGLE_VALUE', | |||
E('ERR_HTTP2_INFO_STATUS_NOT_ALLOWED', | |||
'Informational status codes cannot be used', RangeError); | |||
|
|||
// This should probably be a `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.
Nit: please also remove the line break above as all other errors are directly beneath each other.
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.
I hate to be the Bringer Of The Red X but I'm really reluctant to overload TypeError
like this. This is an invalid value, an invalid object, a malformed parameter, it's all sorts of things but TypeError
doesn't seem like the correct description for it.
@Trott so far we use the |
That could be compelling. Can you point to an example? (Or, of course, point me to where you've already explained this if I'm asking you to repeat something you've already laid out somewhere...) |
I do not have a example handy but I am absolutely certain that I had cases like that before. I can check the V8 code base but I would rather not as it probably takes some time. |
attempting to set the length property of an array if the length property is read only results in a type error: https://github.com/nodejs/node/blob/master/deps/v8/src/accessors.cc#L189 |
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 but I would prefer a test.
@davidmarkclements would you be so kind and add a test? |
@BridgeAR checks added |
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.
Still LGTM
Landed in a37e267 🎉 |
changes the base instance for ERR_HTTP2_INVALID_CONNECTION_HEADERS from Error to TypeError as a more accurate representation of the error. PR-URL: nodejs#19807 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Trivikram Kamat <[email protected]> Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]>
changes the base instance for ERR_HTTP2_INVALID_CONNECTION_HEADERS from Error to TypeError as a more accurate representation of the error. PR-URL: #19807 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Trivikram Kamat <[email protected]> Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]>
changes the base instance for ERR_HTTP2_INVALID_CONNECTION_HEADERS from Error to TypeError as a more accurate representation of the error. PR-URL: nodejs#19807 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Trivikram Kamat <[email protected]> Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]>
changes the base instance for ERR_HTTP2_INVALID_CONNECTION_HEADERS
from Error to TypeError as a more accurate representation
of the error.
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passes