Skip to content
New issue

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

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

Already on GitHub? # to your account

Catch storefront api error when no valid body exists #1205

Merged
merged 2 commits into from
Aug 8, 2023

Conversation

wizardlyhel
Copy link
Contributor

WHY are these changes introduced?

When Storefront api hits status codes like 429 (Too Many Requests) or 430 (Shopify Security Rejection), the response will have no body to parse.

Shopify api status code: https://shopify.dev/docs/api/usage/response-codes

WHAT is this pull request doing?

Surface these errors as actual response errors that developers can take action with instead of TypeError: Body is unusable when response.text() fails.

HOW to test your changes?

Post-merge steps

Checklist

  • I've read the Contributing Guidelines
  • I've considered possible cross-platform impacts (Mac, Linux, Windows)
  • I've added a changeset if this PR contains user-facing or noteworthy changes
  • I've added tests to cover my changes
  • I've added or updated the documentation

@juanpprieto juanpprieto merged commit b29c85d into 2023-07 Aug 8, 2023
@juanpprieto juanpprieto deleted the catch-sfapi-response-errors branch August 8, 2023 23:02
FrcPpe pushed a commit to FrcPpe/hydrogen that referenced this pull request Aug 13, 2023
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants