Handling an connection error with Twython

Cecil Westerhof Cecil at decebal.nl
Thu May 23 09:17:20 EDT 2019


I am using Twython to post updates on Twitter. Lately there is now and
then a problem with my internet connection. I am using:
    posted = twitter.update_status(status = message,
                                   in_reply_to_status_id = message_id,
                                   trim_user = True)

What would be the best way to catch a connection error and try it (for
example) again maximum three times with a delay of one minute?

-- 
Cecil Westerhof
Senior Software Engineer
LinkedIn: http://www.linkedin.com/in/cecilwesterhof


More information about the Python-list mailing list