Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(storage): Improve error messaging for MP upload missing ETag #14170

Merged
merged 4 commits into from
Jan 29, 2025

Conversation

cshfang
Copy link
Member

@cshfang cshfang commented Jan 28, 2025

Description of changes

This PR improves the error messaging around missing ETag parameter when completing multipart uploads. When using non-Amplify configured S3 buckets, it is possible to miss configuring the ExposeHeaders element of the bucket CORS configuration. When hitting this error, the messaging is too vague: Invalid parameter for CompleteMultipartUpload API and the input is logged as [Object object]. This PR adds more context specifically around the missing ETag parameter and stringifies the input for better debugging clarity in the future.

Issue #, if available

#13409

Description of how you validated changes

Reproduced the error by using Amplify to upload to a S3 bucket without ETag as exposed header in CORS configuration. Validated that:

  1. The more specific error message now shows up when ETag is missing
  2. The input object is now stringified

Checklist

  • PR description included
  • yarn test passes
  • Unit Tests are changed or added
  • Relevant documentation is changed or added (and PR referenced)

Checklist for repo maintainers

  • Verify E2E tests for existing workflows are working as expected or add E2E tests for newly added workflows
  • New source file paths included in this PR have been added to CODEOWNERS, if appropriate

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@cshfang cshfang requested a review from a team as a code owner January 28, 2025 22:26
@cshfang cshfang requested a review from a team as a code owner January 28, 2025 22:37
Copy link
Member

@AllanZhengYP AllanZhengYP left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me.

@cshfang cshfang merged commit ba025e5 into aws-amplify:main Jan 29, 2025
30 checks passed
@cshfang cshfang mentioned this pull request Jan 29, 2025
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants