Skip to content

Commit 58a7fd0

Browse files
SirR4TMylesBorins
authored andcommitted
http2: destroy() stream, upon errnoException
First steps towards #19060 Backport-PR-URL: #20456 PR-URL: #19389 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
1 parent a77d3fa commit 58a7fd0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/internal/http2/core.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1647,7 +1647,7 @@ class Http2Stream extends Duplex {
16471647
req.async = false;
16481648
const err = createWriteReq(req, handle, data, encoding);
16491649
if (err)
1650-
throw util._errnoException(err, 'write', req.error);
1650+
return this.destroy(util._errnoException(err, 'write', req.error), cb);
16511651
trackWriteState(this, req.bytes);
16521652
}
16531653

@@ -1690,7 +1690,7 @@ class Http2Stream extends Duplex {
16901690
}
16911691
const err = handle.writev(req, chunks);
16921692
if (err)
1693-
throw util._errnoException(err, 'write', req.error);
1693+
return this.destroy(util._errnoException(err, 'write', req.error), cb);
16941694
trackWriteState(this, req.bytes);
16951695
}
16961696

0 commit comments

Comments
 (0)