Skip to content

Commit

Permalink
errors: alter ERR_HTTP2_PSEUDOHEADER_NOT_ALLOWED
Browse files Browse the repository at this point in the history
changes the base instance for ERR_HTTP2_PSEUDOHEADER_NOT_ALLOWED
from Error to TypeError as a more accurate representation
of the error..

PR-URL: nodejs#19958
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Yuta Hiroto <hello@hiroppy.me>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
  • Loading branch information
davidmarkclements authored and BridgeAR committed May 1, 2018
1 parent 1bf04dd commit 926a8a6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
4 changes: 1 addition & 3 deletions lib/internal/errors.js
Original file line number Diff line number Diff line change
Expand Up @@ -596,10 +596,8 @@ E('ERR_HTTP2_PAYLOAD_FORBIDDEN',
'Responses with %s status must not have a payload', Error);
E('ERR_HTTP2_PING_CANCEL', 'HTTP2 ping cancelled', Error);
E('ERR_HTTP2_PING_LENGTH', 'HTTP2 ping payload must be 8 bytes', RangeError);

// This should probably be a `TypeError`.
E('ERR_HTTP2_PSEUDOHEADER_NOT_ALLOWED',
'Cannot set HTTP/2 pseudo-headers', Error);
'Cannot set HTTP/2 pseudo-headers', TypeError);
E('ERR_HTTP2_PUSH_DISABLED', 'HTTP/2 client has disabled push streams', Error);
E('ERR_HTTP2_SEND_FILE', 'Only regular files can be sent', Error);
E('ERR_HTTP2_SESSION_ERROR', 'Session closed with error code %s', Error);
Expand Down
2 changes: 1 addition & 1 deletion test/parallel/test-http2-compat-serverresponse-headers.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ server.listen(0, common.mustCall(function() {
() => response.setHeader(header, 'foobar'),
{
code: 'ERR_HTTP2_PSEUDOHEADER_NOT_ALLOWED',
type: Error,
type: TypeError,
message: 'Cannot set HTTP/2 pseudo-headers'
})
);
Expand Down

0 comments on commit 926a8a6

Please sign in to comment.