From 69bc678bc770004a4334204a2bdd569f1917c3be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20Molakvo=C3=A6?= Date: Wed, 8 Nov 2023 18:27:14 +0100 Subject: [PATCH] fix(upload): attach response to failed uploads too MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: John Molakvoæ --- lib/uploader.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/uploader.ts b/lib/uploader.ts index 04b6a925..2cb9c28c 100644 --- a/lib/uploader.ts +++ b/lib/uploader.ts @@ -295,6 +295,12 @@ export class Uploader { reject('Upload has been cancelled') return } + + // Attach response to the upload object + if (error?.response) { + upload.response = error.response + } + upload.status = UploadStatus.FAILED logger.error(`Failed uploading ${file.name}`, { error, file, upload }) reject('Failed uploading the file')