excepted return message 34 so it doesn't get logged #39

This commit is contained in:
b3yond 2018-10-11 22:22:37 +02:00
parent cc5ab22be5
commit 4428fa932f

View file

@ -62,9 +62,13 @@ class TwitterDMListener(Bot):
# :todo implement rate limiting
except requests.exceptions.ConnectionError:
logger.error("Twitter API Error: Bad Connection", exc_info=True)
except tweepy.TweepError:
except tweepy.TweepError as terror:
# Waiting for https://github.com/tweepy/tweepy/pull/1109 to get
# merged, so direct messages work again
if terror.api_code == 34:
return reports
logger.error("Twitter API Error: General Error", exc_info=True)
return []
return reports
def post(self, user, report):
pass