Derpseh / Spyglass

Nationstates Sheet-generator for easily finding approximate update times
GNU General Public License v3.0
11 stars 10 forks source link

Error Handling #33

Open AavHRF opened 1 year ago

AavHRF commented 1 year ago

Raised partially in #32 -- the error handling for the API calls is lackluster at best, and could probably stand to be upgraded. Same for the daily dump. Ideally we should use .raise_for_status() as @esfalsa indicated in #32, and it should be used on every API call in order to catch bad data before it corrupts the program run.

Other potential options include manually parsing out the HTTP status code with an if block, which would give us the advantage of being able to fine-tune responses for various codes. This is also the moment where I note that we don't bother to do anything if the API returns a 429. That should probably be changed.

This issue should not be closed out until the following items are resolved:

AavHRF commented 1 year ago

Gah, I forget that automation closes this. Reopening.