Skip to content

Handle http errors more gracefully#37

Open
mjf-ans wants to merge 2 commits intojtpio:masterfrom
mjf-ans:graceful-http-errors
Open

Handle http errors more gracefully#37
mjf-ans wants to merge 2 commits intojtpio:masterfrom
mjf-ans:graceful-http-errors

Conversation

@mjf-ans
Copy link
Copy Markdown

@mjf-ans mjf-ans commented Aug 10, 2022

The HTTP request to the API sometimes gives an error response, with an HTML body. You're currently calling .json() on the Response object, which gives a JSONDecodeError, and hides the HTTP error which is the real cause.

This pull request asks the requests module to explicitly raise a requests.exceptions.HTTPError instead.

Also, if an error occurs when backing up one board, it carries on with the rest of the boards, and reports all the errors at the end.

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