Skip to content

Commit

Permalink
fix: close file stream when error in httpExecutor (#7094)
Browse files Browse the repository at this point in the history
  • Loading branch information
HppZ authored Aug 31, 2022
1 parent b363bcd commit 1023a93
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .changeset/famous-ways-cry.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"builder-util-runtime": patch
"builder-util": patch
---

fix: close file stream when error
1 change: 1 addition & 0 deletions packages/builder-util-runtime/src/httpExecutor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -485,6 +485,7 @@ function configurePipes(options: DownloadCallOptions, response: IncomingMessage)
let lastStream = response
for (const stream of streams) {
stream.on("error", (error: Error) => {
fileOut.close()
if (!options.options.cancellationToken.cancelled) {
options.callback(error)
}
Expand Down

0 comments on commit 1023a93

Please sign in to comment.