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 text responses #2444

Closed
wants to merge 3 commits into from
Closed

Conversation

JoviDeCroock
Copy link
Collaborator

#2442

Summary

Currently we completely error out for a non-JSON response, instead what we could do is get the streamed data as text and try to parse it as JSON. When this fails we can use the textual response as an error as this will more often than not indicate that something went horribly wrong.

Set of changes

  • get streamed data as text and parse later

@changeset-bot
Copy link

changeset-bot bot commented May 13, 2022

🦋 Changeset detected

Latest commit: 8d6c875

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

This PR includes changesets to release 1 package
Name Type
@urql/core 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

@JoviDeCroock JoviDeCroock requested a review from kitten May 16, 2022 08:00
@JoviDeCroock JoviDeCroock deleted the handle-text-responses branch May 24, 2022 15:44
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