fix error detection in mastodon.py
This commit is contained in:
parent
260f15d44a
commit
4b1a6a3a90
|
@ -184,7 +184,9 @@ def refresh_posts(posts):
|
||||||
except (MastodonAPIError,
|
except (MastodonAPIError,
|
||||||
MastodonNetworkError,
|
MastodonNetworkError,
|
||||||
MastodonRatelimitError) as e:
|
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)
|
db.session.delete(post)
|
||||||
else:
|
else:
|
||||||
raise TemporaryError(e)
|
raise TemporaryError(e)
|
||||||
|
|
Loading…
Reference in New Issue