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

improve fetch error handling #4704

Open
wants to merge 5 commits into
base: v3
Choose a base branch
from
Open

improve fetch error handling #4704

wants to merge 5 commits into from

Conversation

derhuerst
Copy link
Member

Currently, almost all places in the code base assume that

  1. network requests are successful – They often fail because state is missing and also don't display an error message.
  2. fetch() rejects on non-2xx responses, which is not the case.

Proposed Changes

This PR introduces a helper function fetchWithErrors that rejects with a FetchError on non-2xx responses, and changes some of the network utility functions in the code base to use it.

Pull Request Check List

  • A reasonable set of unit tests is included
  • Console does not show new warnings/errors – It does show different (the actual) errors now.
  • Changes are documented or they are self explanatory

Review

  • Read and verify the code changes
  • Test the functionality by running the UI locally with all popular browsers available in your platform
  • Check that the implementation matches the design, when such one is defined in a Jira issue
  • Merge the pull request

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.

1 participant