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

Fixes xhr.status check for usePresignedUpload hook #134

Merged

Conversation

williamrjribeiro
Copy link
Contributor

This PR fixes the issue reported here.

💡 Idea
If the promise was settled with the status code, it would enable developers to have fine-grained control over how to handle rejections. For instance, redirecting to another page.

For this to work the Promise would need to resolve a value: { status: xhr.status }. The status type could be strict, like HTTPStatusCode.ts.

@ryanto thoughts? 💭

@vercel
Copy link

vercel bot commented Feb 10, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated
next-s3-upload ✅ Ready (Inspect) Visit Preview 💬 Add your feedback Feb 10, 2023 at 5:22PM (UTC)

@ryanto
Copy link
Owner

ryanto commented Feb 11, 2023

Thanks!

Let me think about best way to reject / throw an error that includes the HTTP status. Think we can come up with something, I wanna see what other AWS libraries are doing before I commit :)

@ryanto ryanto merged commit 016c36d into ryanto:master Feb 11, 2023
@ryanto
Copy link
Owner

ryanto commented Feb 13, 2023

Ok published as 0.2.10, thanks so much for getting this fixed!

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.

2 participants