summaryrefslogtreecommitdiff
path: root/lib/internal
diff options
context:
space:
mode:
authorSarat Addepalli <sarat.addepalli@paytm.com>2018-03-16 17:29:47 +0530
committerAnna Henningsen <anna@addaleax.net>2018-03-23 13:31:00 +0100
commit84afd6e4927113a60ced01b8640903febb259df1 (patch)
treee88e7108769ab01a6410b7fe925a5378e45ab0b7 /lib/internal
parent38bae5dc23723b4f35a1569113caf2c76fb3195d (diff)
downloadnode-new-84afd6e4927113a60ced01b8640903febb259df1.tar.gz
http2: destroy() stream, upon errnoException
First steps towards #19060 PR-URL: https://github.com/nodejs/node/pull/19389 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Diffstat (limited to 'lib/internal')
-rw-r--r--lib/internal/http2/core.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/internal/http2/core.js b/lib/internal/http2/core.js
index 2485a14551..9978df87d6 100644
--- a/lib/internal/http2/core.js
+++ b/lib/internal/http2/core.js
@@ -1680,7 +1680,7 @@ class Http2Stream extends Duplex {
req.async = false;
const err = createWriteReq(req, handle, data, encoding);
if (err)
- throw errnoException(err, 'write', req.error);
+ return this.destroy(errnoException(err, 'write', req.error), cb);
trackWriteState(this, req.bytes);
}
@@ -1723,7 +1723,7 @@ class Http2Stream extends Duplex {
}
const err = handle.writev(req, chunks);
if (err)
- throw errnoException(err, 'write', req.error);
+ return this.destroy(errnoException(err, 'write', req.error), cb);
trackWriteState(this, req.bytes);
}