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>
This commit is contained in:
Sarat Addepalli authored and Anna Henningsen committed 2018-03-23 13:31:00 +01:00
1 parent 38bae5dc23
commit 84afd6e492
1 file changed
+2 -2
+2 -2
View File
@@ -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);
}