jtpio / trello-full-backup

Python script to backup everything from Trello: boards, lists, cards and attachments
MIT License
123 stars 36 forks source link

Handle http errors more gracefully #37

Open mjf-ans opened 2 years ago

mjf-ans commented 2 years ago

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.