Skip to content

Commit

Permalink
fix: close file stream when error
Browse files Browse the repository at this point in the history
  • Loading branch information
haopeng committed Aug 31, 2022
1 parent 48cbb12 commit 5fdd3e6
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions packages/builder-util-runtime/src/httpExecutor.ts
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 5fdd3e6

Please sign in to comment.