added specific error for rate limit exceeded

This commit is contained in:
Lynne 2019-05-07 03:02:42 +10:00
parent ddbd2f10ad
commit a8ac5869d0
1 changed files with 8 additions and 0 deletions

View File

@ -196,6 +196,14 @@ for f in following:
print('.', end='', flush=True)
print(" Done!")
db.commit()
except requests.HTTPError as e:
if e.response.status_code == 429:
print("Rate limit exceeded. This means we're downloading too many posts in quick succession. Saving toots to database and moving to next followed account.")
db.commit()
else:
# TODO: remove duplicate code
print("Encountered an error! Saving toots to database and moving to next followed account.")
db.commit()
except:
print("Encountered an error! Saving toots to database and moving to next followed account.")
db.commit()