Try/catch wrap on timeline fetching in TwitterCog
This commit is contained in:
commit
a48def517f
1 changed files with 4 additions and 1 deletions
|
@ -43,7 +43,10 @@ class TwitterCog(commands.Cog):
|
|||
handles = Twitter.objects.distinct("handle")
|
||||
twitter_data = {}
|
||||
for handle in handles:
|
||||
try:
|
||||
twitter_data[handle] = self.api.user_timeline(screen_name=handle)
|
||||
except Exception as e:
|
||||
logger.error(f"Error with fetching: {e}")
|
||||
for twitter in twitters:
|
||||
try:
|
||||
tweets = list(filter(lambda x: x.id > twitter.last_tweet, twitter_data[twitter.handle]))
|
||||
|
|
Loading…
Add table
Reference in a new issue