Repository navigation
fix(storage): re-throw upload error after aborting in uploadFileInChunks - #9566
thiyaguk09 wants to merge 10 commits into
Conversation
There was a problem hiding this comment.
Code Review
This pull request updates the error handling in TransferManager during multipart upload failures, ensuring that if aborting the upload also fails, a MultiPartUploadError combining both the original error and the abort error is thrown. Unit tests have been updated and added to verify this behavior. Feedback suggests a more defensive approach to extracting error messages from the caught exceptions to avoid potential runtime TypeErrors if the thrown values are not standard Error objects.
…to handle non-Error objects
kalragauri
left a comment
There was a problem hiding this comment.
The PR description contains file:///usr/local/google/home/thiyaguk/... links in the raw markdown that do not render as working links on GitHub. These local file:// URLs will also be recorded permanently in the commit message.
Consider replacing the file:// links with actual file paths.
…ad failure catch block
updated. |
Description
Ensures
TransferManager.uploadFileInChunksalways rejects with aMultiPartUploadErrorwhen a multipart upload fails, even when automatic cleanup (abortUpload) succeeds.Impact
Prevents silent data loss where failed chunked uploads previously resolved to
undefinedafter aborting the multipart upload, misleading callers into assuming the file upload succeeded.Changes
return;statement inuploadFileInChunksaftermpuHelper.abortUpload()succeeds so that the original upload error is thrown as aMultiPartUploadError.mpuHelper.abortUpload()also fails.Testing
abortUploadunit test intest/transfer-manager.tsto assert thatuploadFileInChunksrejects with the original upload error whenabortUploadsucceeds.test/transfer-manager.tsverifying that when bothuploadPartandabortUploadfail, the rejectedMultiPartUploadErrorincludes both error messages.Fixes #9193