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 error-handling for non-JSON response #66

Open
TomOnTime opened this issue Apr 20, 2022 · 0 comments
Open

Improve error-handling for non-JSON response #66

TomOnTime opened this issue Apr 20, 2022 · 0 comments

Comments

@TomOnTime
Copy link

Frequently I get an error from the library as follows:

Fail to decode the response body (error 'invalid character '<' looking for beginning of value')

I haven't looked deeply into the code but it looks like there are some errors that return a textual error message, not a JSON blob to be parsed. The code seems to try to parse it as JSON anyway and thus returns the above error.

I bet there's an error code or something that can be used to determine that the payload isn't JSON and should just be used as the error string.

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