summaryrefslogtreecommitdiff
path: root/test/parallel/test-http2-misbehaving-multiplex.js
diff options
context:
space:
mode:
authorMatteo Collina <hello@matteocollina.com>2018-03-08 16:22:23 +0100
committerMyles Borins <mylesborins@google.com>2018-03-21 11:04:46 +0000
commit3914e977414c05849553328e375c8fb2c2aaa347 (patch)
tree05ec91862899bc179669897384414a30f1b78b85 /test/parallel/test-http2-misbehaving-multiplex.js
parent55f7bbb0bd111c42ad7970473f44b2dd8da00a03 (diff)
downloadnode-new-3914e977414c05849553328e375c8fb2c2aaa347.tar.gz
http2: fixes error handling
There should be no default error handling when using Http2Stream. All errors will end up in `'streamError'` on the server anyway, but they are emitted on `'stream'` as well, otherwise some error conditions are impossible to debug. See: https://github.com/nodejs/node/pull/14991 Backport-PR-URL: https://github.com/nodejs/node/pull/19478 PR-URL: https://github.com/nodejs/node/pull/19232 Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'test/parallel/test-http2-misbehaving-multiplex.js')
-rw-r--r--test/parallel/test-http2-misbehaving-multiplex.js7
1 files changed, 7 insertions, 0 deletions
diff --git a/test/parallel/test-http2-misbehaving-multiplex.js b/test/parallel/test-http2-misbehaving-multiplex.js
index 7d5a7a2f55..757e66b100 100644
--- a/test/parallel/test-http2-misbehaving-multiplex.js
+++ b/test/parallel/test-http2-misbehaving-multiplex.js
@@ -14,7 +14,14 @@ const server = h2.createServer();
server.on('stream', common.mustCall((stream) => {
stream.respond();
stream.end('ok');
+
+ // the error will be emitted asynchronously
+ stream.on('error', common.expectsError({
+ code: 'ERR_HTTP2_ERROR',
+ message: 'Stream was already closed or invalid'
+ }));
}, 2));
+
server.on('session', common.mustCall((session) => {
session.on('error', common.expectsError({
code: 'ERR_HTTP2_ERROR',