Skip to content

Commit 84afd6e

Browse files
SirR4Taddaleax
authored andcommitted
http2: destroy() stream, upon errnoException
First steps towards #19060 PR-URL: #19389 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Matteo Collina <[email protected]>
1 parent 38bae5d commit 84afd6e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/internal/http2/core.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1680,7 +1680,7 @@ class Http2Stream extends Duplex {
16801680
req.async = false;
16811681
const err = createWriteReq(req, handle, data, encoding);
16821682
if (err)
1683-
throw errnoException(err, 'write', req.error);
1683+
return this.destroy(errnoException(err, 'write', req.error), cb);
16841684
trackWriteState(this, req.bytes);
16851685
}
16861686

@@ -1723,7 +1723,7 @@ class Http2Stream extends Duplex {
17231723
}
17241724
const err = handle.writev(req, chunks);
17251725
if (err)
1726-
throw errnoException(err, 'write', req.error);
1726+
return this.destroy(errnoException(err, 'write', req.error), cb);
17271727
trackWriteState(this, req.bytes);
17281728
}
17291729

0 commit comments

Comments
 (0)