Skip to content

Commit 714f93a

Browse files
authored
Merge pull request #2124 from akashchi/reject-on-download-failure
[ARTIFACT] Reject download promise if timeout was reached
2 parents f2ba502 + 8444236 commit 714f93a

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

packages/artifact/src/internal/download/download-artifact.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,11 @@ export async function streamExtractExternal(
7979

8080
return new Promise((resolve, reject) => {
8181
const timerFn = (): void => {
82-
response.message.destroy(
83-
new Error(`Blob storage chunk did not respond in ${timeout}ms`)
82+
const timeoutError = new Error(
83+
`Blob storage chunk did not respond in ${timeout}ms`
8484
)
85+
response.message.destroy(timeoutError)
86+
reject(timeoutError)
8587
}
8688
const timer = setTimeout(timerFn, timeout)
8789

0 commit comments

Comments
 (0)