mirror of
https://github.com/MCV-Software/TWBlue.git
synced 2024-11-23 03:38:08 -06:00
Mastodon: Raise exception when replying to a deleted post
This commit is contained in:
parent
96dc99a93b
commit
1fa1313434
@ -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:
|
||||||
|
Loading…
Reference in New Issue
Block a user