summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordavidmarkclements <huperekchuno@googlemail.com>2018-04-04 21:11:27 +0200
committerJames M Snell <jasnell@gmail.com>2018-04-14 13:18:21 -0700
commitcc7bef9eed6641aa0e821139b9d5227f4ae81496 (patch)
tree7c64caed3359f262040f81d79facd86a3d9af528
parente76831be0ca92585f2e4a3caf26875c6963b6019 (diff)
downloadandroid-node-v8-cc7bef9eed6641aa0e821139b9d5227f4ae81496.tar.gz
android-node-v8-cc7bef9eed6641aa0e821139b9d5227f4ae81496.tar.bz2
android-node-v8-cc7bef9eed6641aa0e821139b9d5227f4ae81496.zip
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: https://github.com/nodejs/node/pull/19958 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Yuta Hiroto <hello@hiroppy.me> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
-rw-r--r--lib/internal/errors.js4
-rw-r--r--test/parallel/test-http2-compat-serverresponse-headers.js2
2 files changed, 2 insertions, 4 deletions
diff --git a/lib/internal/errors.js b/lib/internal/errors.js
index c2a0f08620..35c3fb74b0 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 8c8c4867dd..94f1d19373 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'
})
);