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: #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 jasnell committed Apr 16, 2018
1 parent 3c1ad38 commit f086354
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 @@ -826,10 +826,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', 'Directories cannot be sent', Error);
E('ERR_HTTP2_SEND_FILE_NOSEEK',
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 @@ -63,7 +63,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 f086354

Please sign in to comment.