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

feat: Improved Fetch Errors #8921

Merged
merged 4 commits into from
Sep 25, 2023
Merged

feat: Improved Fetch Errors #8921

merged 4 commits into from
Sep 25, 2023

Conversation

runspired
Copy link
Contributor

@runspired runspired commented Sep 25, 2023

resolves #8898
resolves #8899

Adds realistic test coverage using the new mock. Also improves the types for the request package a bit.

Note: this slightly deviates from the AdapterError pattern.

  • code now mirrors status because otherwise AbortError is unique. e.g. 404 instead of "NotFoundError"
  • name fills the roll of AdapterError.code e.g. "NotFoundError"
  • statusText is added for errors when missing due to being http/2 requests
  • status is added and reflects response.status
  • isRequestError: true is added
  • If the response body of the error is an array, or has an errors property that is an array we throw an AggregateError with the errors array.

@runspired runspired added 🎯 canary PR is targeting canary (default) 🏷️ feat This PR introduces a new feature labels Sep 25, 2023
@runspired runspired merged commit afa95a3 into main Sep 25, 2023
21 checks passed
@delete-merged-branch delete-merged-branch bot deleted the improved-errors branch September 25, 2023 09:27
BoussonKarel pushed a commit to BoussonKarel/data that referenced this pull request Oct 6, 2023
* nice things

* add abort test

* better errors detection logic

* fix lint
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🎯 canary PR is targeting canary (default) 🏷️ feat This PR introduces a new feature
Projects
Archived in project
1 participant