1
0
Fork 0

Close destination steam before reject

Co-authored-by: Chris Sidi <hashtagchris@github.com>
pull/661/head
Yang Cao 2020-12-04 11:03:17 -05:00 committed by GitHub
parent 5be846b72d
commit b593d1deb4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 3 deletions

View File

@ -315,16 +315,17 @@ export class DownloadHttpClient {
core.error(
`An error occurred while attempting to read the response stream`
)
reject(error)
gunzip.close()
destinationStream.close()
reject(error)
})
.pipe(gunzip)
.on('error', error => {
core.error(
`An error occurred while attempting to decompress the response stream`
)
reject(error)
destinationStream.close()
reject(error)
})
.pipe(destinationStream)
.on('close', () => {
@ -342,8 +343,8 @@ export class DownloadHttpClient {
core.error(
`An error occurred while attempting to read the response stream`
)
reject(error)
destinationStream.close()
reject(error)
})
.pipe(destinationStream)
.on('close', () => {