Skip to content

use requests.JSONDecodeError to catch more requests errors#232

Merged
isabelizimm merged 1 commit intomainfrom
requests-json-errors
Apr 30, 2024
Merged

use requests.JSONDecodeError to catch more requests errors#232
isabelizimm merged 1 commit intomainfrom
requests-json-errors

Conversation

@isabelizimm
Copy link
Collaborator

Right now, we are using json.JSONDecodeError, but depending on Python version, json.JSONDecodeError, simplejson.JSONDecodeError, ValueError, requests.JSONDecodeError, or requests.RequestException, could be sent from the request. All 5 types are captured by requests.JSONDecodeError, so let's use this to give more informative errors.

@isabelizimm isabelizimm changed the title catch all json errors use requests.JSONDecodeError to catch more requests errors Apr 30, 2024
@isabelizimm isabelizimm merged commit 2b7bebb into main Apr 30, 2024
@isabelizimm isabelizimm deleted the requests-json-errors branch April 30, 2024 20:38
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