Mastodon: Raise exception when replying to a deleted post

This commit is contained in:
Manuel Cortez 2023-04-03 15:17:03 -06:00
parent 96dc99a93b
commit 1fa1313434
No known key found for this signature in database
GPG Key ID: 9E0735CA15EFE790

View File

@ -11,7 +11,7 @@ import config
import config_utils import config_utils
import output import output
import application import application
from mastodon import MastodonError, MastodonNotFoundError, MastodonUnauthorizedError from mastodon import MastodonError, MastodonAPIError, MastodonNotFoundError, MastodonUnauthorizedError
from pubsub import pub from pubsub import pub
from mysc.thread_utils import call_threaded from mysc.thread_utils import call_threaded
from sessions import base from sessions import base
@ -189,8 +189,10 @@ class Session(base.baseSession):
finished = True finished = True
except Exception as e: except Exception as e:
output.speak(str(e)) output.speak(str(e))
if isinstance(e, MastodonAPIError):
log.exception("API Error returned when making a Call on {}. Call name={}, args={}, kwargs={}".format(self.get_name(), call_name, args, kwargs))
raise e
val = None val = None
if type(e) != MastodonNotFoundError and type(e) != MastodonUnauthorizedError :
tries = tries+1 tries = tries+1
time.sleep(5) time.sleep(5)
if tries == 4 and finished == False: if tries == 4 and finished == False: