From 9f7af6f342ee60170f8c5e308c5a93cd2bd4dcfe Mon Sep 17 00:00:00 2001 From: Andrei Kashchikhin Date: Wed, 24 Sep 2025 17:05:25 +0200 Subject: [PATCH] use error in both reject and destroy --- src/internal/download/download-artifact.ts | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/internal/download/download-artifact.ts b/src/internal/download/download-artifact.ts index 1616aff..d001a2f 100644 --- a/src/internal/download/download-artifact.ts +++ b/src/internal/download/download-artifact.ts @@ -79,10 +79,9 @@ export async function streamExtractExternal( return new Promise((resolve, reject) => { const timerFn = (): void => { - response.message.destroy( - new Error(`Blob storage chunk did not respond in ${timeout}ms`) - ) - reject(`Blob storage chunk did not respond in ${timeout}ms`) + const timeoutError = new Error(`Blob storage chunk did not respond in ${timeout}ms`) + response.message.destroy(timeoutError) + reject(timeoutError) } const timer = setTimeout(timerFn, timeout)