Skip to content

Commit eddf3a6

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 <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Matteo Collina <[email protected]>
1 parent 83d8ad3 commit eddf3a6

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
@@ -1644,7 +1644,7 @@ class Http2Stream extends Duplex {
16441644
req.async = false;
16451645
const err = createWriteReq(req, handle, data, encoding);
16461646
if (err)
1647-
throw util._errnoException(err, 'write', req.error);
1647+
return this.destroy(util._errnoException(err, 'write', req.error), cb);
16481648
trackWriteState(this, req.bytes);
16491649
}
16501650

@@ -1687,7 +1687,7 @@ class Http2Stream extends Duplex {
16871687
}
16881688
const err = handle.writev(req, chunks);
16891689
if (err)
1690-
throw util._errnoException(err, 'write', req.error);
1690+
return this.destroy(util._errnoException(err, 'write', req.error), cb);
16911691
trackWriteState(this, req.bytes);
16921692
}
16931693

0 commit comments

Comments
 (0)