diff --git a/lib/internal/errors.js b/lib/internal/errors.js index c2a0f086201aef..35c3fb74b08216 100644 --- a/lib/internal/errors.js +++ b/lib/internal/errors.js @@ -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', diff --git a/test/parallel/test-http2-compat-serverresponse-headers.js b/test/parallel/test-http2-compat-serverresponse-headers.js index 8c8c4867dd4963..94f1d19373742c 100644 --- a/test/parallel/test-http2-compat-serverresponse-headers.js +++ b/test/parallel/test-http2-compat-serverresponse-headers.js @@ -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' }) );