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

Systematically raise for status on request and uniformize exception handling #359

Merged
merged 1 commit into from
Nov 22, 2023

Conversation

ssssarah
Copy link
Contributor

@ssssarah ssssarah commented Nov 22, 2023

There were some calls to Delta that didn't request.raise_for_status() and so there would be an attempt to parse the body even though there wasn't one.
This was noticed for example when a forge instance would have its token expire and some error codes in requests would not be checked, the body would be parsed, and a json error would be thrown.

For all requests.___ calls, the same _catch_http_error is being called. This also improves code readability to avoid having the the same try-except block repeated across the file.

Adresses #164

@ssssarah ssssarah self-assigned this Nov 22, 2023
Copy link
Collaborator

@lecriste lecriste left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me.

@ssssarah ssssarah merged commit ebb7818 into master Nov 22, 2023
@ssssarah ssssarah deleted the token_expired_error branch November 22, 2023 14:33
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.

2 participants