Skip to content

Commit

Permalink
fix(upload): attach response to failed uploads too
Browse files Browse the repository at this point in the history
Signed-off-by: John Molakvoæ <[email protected]>
  • Loading branch information
skjnldsv committed Nov 8, 2023
1 parent 78ba099 commit 69bc678
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/uploader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down

0 comments on commit 69bc678

Please sign in to comment.