-
Notifications
You must be signed in to change notification settings - Fork 50
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
Meta issue for JSONDecode errors we see often lately #163
Comments
This is what I do to catch such errors in an application using
I'm not 100% sure since this error is hard to reproduce but I'm pretty sure this must catch |
@AnssiAhola do you think we could include the catching of the JSONDecodeError (only! not other exceptions!) into the core of the client? I'm not sure if simply wrapping the "main fetch wrapper": discogs_client/discogs_client/fetchers.py Lines 57 to 61 in 98059c0
in a try except is the best idea or an approach like the backoff decorator is a better solution: discogs_client/discogs_client/utils.py Lines 44 to 48 in 98059c0
or is all this a bad idea anyway? And of course we should add tests for it! |
Several users have reported similar randomly happening JSONDecode errors when retrieving arbitrary stuff via python3-discogs-client. I experienced it myself and post my experience soon. I'd like to summarize discussion and improvement suggestions in this issue here.
In my opinion it looks like api.discogs.com responds with unexpected data but only sometimes. I would guess it is a problem on their end for whatever reason, and they might be aware of and working on it already, or not..... In the end we have to live with it and find a workaround.
A second reason is that our backoff mechanism could be faulty or not compatible anymore since something might have changed at Discogs. It worked very well for us so far and it's in place since ...about 4 years already....#34
Related reports so far:
Did any of you solve the issue simply with try/except catchin jsondecode errors? If yes, share you experience, maybe a simple fix like that can be included in python3-discogs-client already.
Can this problem be reproduced when using api.discogs.com simply with Python requests module only?
The text was updated successfully, but these errors were encountered: