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

fix(core): Handle fetch rejections and pass to makeErrorResult #3131

Merged
merged 1 commit into from
Apr 5, 2023

Conversation

kitten
Copy link
Member

@kitten kitten commented Apr 5, 2023

Resolves #3128

Summary

We had a missing catch case, where !response wasn't handled, which can happen if fetch rejects immediately rather than delivering a failed response. This would happen in particular due to offline network errors or broken connection attempts.

This is a regression introduced in the fetch refactor, and was introduced because we don't have two catch handlers anymore, hence response! was an invalid non-undefined assertion.

Set of changes

  • Add missing !response case
  • Add test

@kitten kitten merged commit 9cdb74b into main Apr 5, 2023
@kitten kitten deleted the fix/handle-fetch-rejections branch April 5, 2023 18:48
@github-actions github-actions bot mentioned this pull request Apr 5, 2023
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.

fetchOperation throws "Cannot read properties of undefined" when client is offline
2 participants