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

Guard against JSON parsing errors #8

Open
BrendanDavies opened this issue May 7, 2018 · 0 comments
Open

Guard against JSON parsing errors #8

BrendanDavies opened this issue May 7, 2018 · 0 comments

Comments

@BrendanDavies
Copy link
Collaborator

Currently in the onSuccess handler, there is a catch function for reading the JSON response, that tries to read the stream again (via .text()) here.

This causes any possible parsing error to be masked by a TypeError: body stream already read since we are trying to read a stream twice.

The catch function should be refactored to guard against the body already being streamed !response.bodyUsed.

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

No branches or pull requests

1 participant