diff --git a/lib/internal/http2/core.js b/lib/internal/http2/core.js index d2701dfb84db12..64eef584fec06f 100644 --- a/lib/internal/http2/core.js +++ b/lib/internal/http2/core.js @@ -2151,14 +2151,11 @@ function processHeaders(oldHeaders) { return headers; } -function onFileCloseError(stream, err) { - stream.emit(err); -} function onFileUnpipe() { const stream = this.sink[kOwner]; if (stream.ownsFd) - this.source.close().catch(onFileCloseError.bind(stream)); + this.source.close().catch(stream.destroy.bind(stream)); else this.source.releaseFD(); }