Commit e91d4b2a authored by Hiro's avatar Hiro 🏄
Browse files

Fix error and call backs in twitter message responder

parent 983dbbd6
......@@ -100,7 +100,6 @@ class Sendmail(object):
).addCallback(self.sendmail_callback).addErrback(self.sendmail_errback)
@defer.inlineCallbacks
def get_new(self):
"""
......@@ -178,7 +177,7 @@ class Sendmail(object):
# build message
link_msg = None
file = ""
for link in links:
provider = link[5]
version = link[4]
......
......@@ -80,7 +80,9 @@ class Twitterdm(object):
:return: deferred whose callback/errback will handle the API execution
details.
"""
return self.send_tweet(twitter_id, message)
return self.send_tweet(
twitter_id, message
).addCallback(self.twitter_callback).addErrback(self.twitter_errback)
def send_tweet(self, twitter_id, message):
......@@ -89,9 +91,10 @@ class Twitterdm(object):
)
if post_data.status_code == 200:
time.sleeps(30)
self.twitter_callback
else:
self.twitter_errback
raise RuntimeError as e:
log.info("Error sending message: {}.".format(e))
return post_data
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment