diff --git a/lib/internal/http2/core.js b/lib/internal/http2/core.js index 11d677c5f66a31..95ce8bcdb4ede8 100644 --- a/lib/internal/http2/core.js +++ b/lib/internal/http2/core.js @@ -2152,14 +2152,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(); }