forked from ticketfrei/ticketfrei
Merge pull request #92 from ticketfrei/masto502
don't log Mastodon 502 errors.
This commit is contained in:
commit
79f16f13d4
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
from bot import Bot
|
from bot import Bot
|
||||||
import logging
|
import logging
|
||||||
from mastodon import Mastodon
|
from mastodon import Mastodon, MastodonServerError
|
||||||
import re
|
import re
|
||||||
from report import Report
|
from report import Report
|
||||||
|
|
||||||
|
@ -25,8 +25,8 @@ class MastodonBot(Bot):
|
||||||
return mentions
|
return mentions
|
||||||
try:
|
try:
|
||||||
notifications = m.notifications()
|
notifications = m.notifications()
|
||||||
except Exception:
|
except MastodonServerError:
|
||||||
logger.error("Unknown Mastodon API Error.", exc_info=True)
|
logger.error("Unknown Mastodon API Error: 502")
|
||||||
return mentions
|
return mentions
|
||||||
for status in notifications:
|
for status in notifications:
|
||||||
if (status['type'] == 'mention' and
|
if (status['type'] == 'mention' and
|
||||||
|
|
Loading…
Reference in a new issue