Skip to content

Commit

Permalink
Prettier exception printing
Browse files Browse the repository at this point in the history
Print now tells us if it's the first time it gets an error and retry or if it cannot send the tweet at all
  • Loading branch information
LilithL authored Sep 21, 2020
1 parent adf7867 commit 5a6f2ea
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,13 @@ def tweet_parser(twi_api, texte, toot_cont_warn, last_tweet_id=None, toot_media=
last_tweet_id = twi_api.PostUpdate(status=formated_cw + contenu, in_reply_to_status_id=last_tweet_id,
verify_status_length=False, media=toot_media).id
except Exception as e:
print(e)
print("Erreur, prochain essais dans 3 secondes : ", e)
time.sleep(3)
try:
last_tweet_id = twi_api.PostUpdate(status=formated_cw + contenu, in_reply_to_status_id=last_tweet_id,
verify_status_length=False, media=toot_media).id
except Exception as e:
print(e)
print("Erreur, pas de nouvelles tentatives: ", e)
return
return last_tweet_id

Expand Down

0 comments on commit 5a6f2ea

Please sign in to comment.