From 96ef8d5d33c7290744608a5ec754df3012384e5b Mon Sep 17 00:00:00 2001 From: Vallie Joseph Date: Mon, 1 Apr 2024 20:21:01 +0000 Subject: [PATCH] adding more error handling --- packages/artifact/src/internal/upload/zip.ts | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/packages/artifact/src/internal/upload/zip.ts b/packages/artifact/src/internal/upload/zip.ts index 68e24636..e5f5b6af 100644 --- a/packages/artifact/src/internal/upload/zip.ts +++ b/packages/artifact/src/internal/upload/zip.ts @@ -43,9 +43,14 @@ export async function createZipUploadStream( zip.on('finish', zipFinishCallback) zip.on('end', zipEndCallback) // see https://caolan.github.io/async/v3/docs.html#queue for options - const fileUploadQueue = async.queue(function (task, callback) { - core.debug(`adding file to upload queue ${task}`) - callback() + const fileUploadQueue = async.queue(function (fileItem, callback) { + try { + core.debug(`adding ${fileItem} to the file queue`) + callback() + } catch (err) { + core.error(`task experienced an error: ${fileItem} ${err}`) + callback(err) + } }) // concurrency for uploads automatically set to 1 fileUploadQueue.error(function (err, task) {