Skip to content

Commit 7b850a7

Browse files
SirR4Ttargos
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 dac5f67 commit 7b850a7

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
@@ -1646,7 +1646,7 @@ class Http2Stream extends Duplex {
16461646
req.async = false;
16471647
const err = createWriteReq(req, handle, data, encoding);
16481648
if (err)
1649-
throw errors.errnoException(err, 'write', req.error);
1649+
return this.destroy(errors.errnoException(err, 'write', req.error), cb);
16501650
trackWriteState(this, req.bytes);
16511651
}
16521652

@@ -1689,7 +1689,7 @@ class Http2Stream extends Duplex {
16891689
}
16901690
const err = handle.writev(req, chunks);
16911691
if (err)
1692-
throw errors.errnoException(err, 'write', req.error);
1692+
return this.destroy(errors.errnoException(err, 'write', req.error), cb);
16931693
trackWriteState(this, req.bytes);
16941694
}
16951695

0 commit comments

Comments
 (0)