From 4b1a6a3a90e84e908bfdf596257aeb3cd468f865 Mon Sep 17 00:00:00 2001 From: codl Date: Sun, 17 Sep 2017 15:12:01 +0200 Subject: [PATCH] fix error detection in mastodon.py --- lib/mastodon.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/mastodon.py b/lib/mastodon.py index 4c85f00..3fb4f39 100644 --- a/lib/mastodon.py +++ b/lib/mastodon.py @@ -184,7 +184,9 @@ def refresh_posts(posts): except (MastodonAPIError, MastodonNetworkError, MastodonRatelimitError) as e: - if str(e) in ('Endpoint not found.', 'Record not found.'): + if any([ + err in str(e) + for err in ('Endpoint not found.', 'Record not found.')]): db.session.delete(post) else: raise TemporaryError(e)