GrafeasGroup / tor

Community curation bot for /r/TranscribersOfReddit
https://reddit.com/r/transcribersofreddit
MIT License
39 stars 15 forks source link

Handle HTTP status codes > 599 #368

Open itsthejoker opened 1 year ago

itsthejoker commented 1 year ago

So it turns out that there are HTTP status codes higher than 599. During the Reddit outage, there was a brief period where we received HTTP 777 codes from Fastly. This should be an extremely rare occurrence, but we should still be able to catch it.

In tor.core.helpers.run_until_dead, we watch for exceptions here: https://github.com/GrafeasGroup/tor/blob/main/tor/core/helpers.py#L246 The only hint we have from bugsnag is "unexpected status code", so we need to figure out what threw that error (probably requests?), what exception that is, and then update run_until_dead to catch that exception as a general Reddit communication error.

Once identified, the fix should also be applied to tor_ocr and tor_archivist.