From 04e05ee8ca754815d35b83c7d3679daacb723dc0 Mon Sep 17 00:00:00 2001 From: b3yond Date: Fri, 19 Jan 2018 00:17:09 +0100 Subject: [PATCH] excepted Mastodon API Error with a too broad exception --- retootbot.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/retootbot.py b/retootbot.py index 31e0ab4..b545cef 100755 --- a/retootbot.py +++ b/retootbot.py @@ -70,8 +70,12 @@ class RetootBot(object): :return: list of statuses """ - all = self.m.notifications() mentions = [] + try: + all = self.m.notifications() + except: # mastodon.Mastodon.MastodonAPIError is unfortunately not in __init__.py + logger.error("Unknown Mastodon API Error.", exc_info=True) + return mentions for status in all: if (status['type'] == 'mention' and status['status']['id'] not in self.seen_toots): # save state