Skip to content

Commit f086354

Browse files
davidmarkclementsjasnell
authored andcommitted
errors: alter ERR_HTTP2_PSEUDOHEADER_NOT_ALLOWED
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 <[email protected]> Reviewed-By: Yuta Hiroto <[email protected]> Reviewed-By: Trivikram Kamat <[email protected]>
1 parent 3c1ad38 commit f086354

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

lib/internal/errors.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -826,10 +826,8 @@ E('ERR_HTTP2_PAYLOAD_FORBIDDEN',
826826
'Responses with %s status must not have a payload', Error);
827827
E('ERR_HTTP2_PING_CANCEL', 'HTTP2 ping cancelled', Error);
828828
E('ERR_HTTP2_PING_LENGTH', 'HTTP2 ping payload must be 8 bytes', RangeError);
829-
830-
// This should probably be a `TypeError`.
831829
E('ERR_HTTP2_PSEUDOHEADER_NOT_ALLOWED',
832-
'Cannot set HTTP/2 pseudo-headers', Error);
830+
'Cannot set HTTP/2 pseudo-headers', TypeError);
833831
E('ERR_HTTP2_PUSH_DISABLED', 'HTTP/2 client has disabled push streams', Error);
834832
E('ERR_HTTP2_SEND_FILE', 'Directories cannot be sent', Error);
835833
E('ERR_HTTP2_SEND_FILE_NOSEEK',

test/parallel/test-http2-compat-serverresponse-headers.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ server.listen(0, common.mustCall(function() {
6363
() => response.setHeader(header, 'foobar'),
6464
{
6565
code: 'ERR_HTTP2_PSEUDOHEADER_NOT_ALLOWED',
66-
type: Error,
66+
type: TypeError,
6767
message: 'Cannot set HTTP/2 pseudo-headers'
6868
})
6969
);

0 commit comments

Comments
 (0)