Skip to content

Commit

Permalink
http2: destroy() stream, upon errnoException
Browse files Browse the repository at this point in the history
First steps towards nodejs#19060
  • Loading branch information
SirR4T committed Mar 16, 2018
1 parent c979488 commit 2882196
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/internal/http2/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -1677,7 +1677,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);
}

Expand Down Expand Up @@ -1720,7 +1720,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);
}

Expand Down

0 comments on commit 2882196

Please sign in to comment.