mirror of
https://github.com/TheFunny/ArisuAutoSweeper
synced 2026-10-11 02:32:16 +00:00
feat: add error postprocessing method and invoke on exceptions
This commit is contained in:
@@ -124,6 +124,7 @@ class AzurLaneAutoScript:
|
||||
return False
|
||||
except ScriptError as e:
|
||||
logger.exception(e)
|
||||
self.error_postprocess()
|
||||
logger.critical('This is likely to be a mistake of developers, but sometimes just random issues')
|
||||
self.save_error_log()
|
||||
handle_notify(
|
||||
@@ -134,6 +135,7 @@ class AzurLaneAutoScript:
|
||||
exit(1)
|
||||
except RequestHumanTakeover:
|
||||
logger.critical('Request human takeover')
|
||||
self.error_postprocess()
|
||||
handle_notify(
|
||||
self.config.Error_OnePushConfig,
|
||||
title=f"AAS <{self.config_name}> crashed",
|
||||
@@ -142,6 +144,7 @@ class AzurLaneAutoScript:
|
||||
exit(1)
|
||||
except Exception as e:
|
||||
logger.exception(e)
|
||||
self.error_postprocess()
|
||||
self.save_error_log()
|
||||
handle_notify(
|
||||
self.config.Error_OnePushConfig,
|
||||
@@ -157,6 +160,12 @@ class AzurLaneAutoScript:
|
||||
"""
|
||||
save_error_log(config=self.config, device=self.device)
|
||||
|
||||
def error_postprocess(self):
|
||||
"""
|
||||
Do something when error occurred
|
||||
"""
|
||||
pass
|
||||
|
||||
def wait_until(self, future):
|
||||
"""
|
||||
Wait until a specific time.
|
||||
|
||||
Reference in New Issue
Block a user