vercel / storage

Vercel Postgres, KV, Blob, and Edge Config
https://vercel.com/storage
Apache License 2.0
517 stars 58 forks source link

Handle promise rejection #665

Closed wyattjoh closed 7 months ago

wyattjoh commented 7 months ago

This handles the promise rejection when the latestRequest rejects. It's important to add where we used to have the void as invoking the .then will wait another microtick as well as re-throw any error that occurred during the initial promise. The promise is returned later, and ensures that the promise can be await'ed and/or handled.

Note, you may need to turn off hide whitespace to see the changes, I swapped out the ??= to make it more explicit as to when the initialization of the promises occurred.

changeset-bot[bot] commented 7 months ago

🦋 Changeset detected

Latest commit: b6e6eb5d85ba26821f0dda9f50f6589caa2d335a

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages | Name | Type | | ------------------------------------- | ----- | | @vercel/edge-config | Patch | | vercel-storage-integration-test-suite | Patch |

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

vercel[bot] commented 7 months ago

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

Name Status Preview Updated (UTC)
vercel-storage-next-integration-test-suite ✅ Ready (Inspect) Visit Preview Apr 25, 2024 1:26pm