From 78ed49ff8807a9c7aee2376c68719f799afbeb6b Mon Sep 17 00:00:00 2001 From: srryan Date: Tue, 19 Dec 2023 12:46:58 -0500 Subject: [PATCH] update error handling abort --- .../artifact/src/internal/download/download-artifact.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/packages/artifact/src/internal/download/download-artifact.ts b/packages/artifact/src/internal/download/download-artifact.ts index bc64d51d..6ff72a02 100644 --- a/packages/artifact/src/internal/download/download-artifact.ts +++ b/packages/artifact/src/internal/download/download-artifact.ts @@ -50,10 +50,11 @@ async function streamExtract(url: string, directory: string): Promise { return new Promise((resolve, reject) => { response.readableStreamBody - ?.pipe(unzip.Extract({path: directory})) - .on('close', resolve) - .on('error', reject) + ?.on('error', reject) .on('aborted', reject) + .pipe(unzip.Extract({path: directory})) + .on('error', reject) + .on('close', resolve) }) }