From d83ce3bdc36fd19e33423b8e7e9aef07a8bcc6ec Mon Sep 17 00:00:00 2001 From: YoursFunny Date: Mon, 6 Jul 2026 11:32:59 +0800 Subject: [PATCH] feat: add error postprocessing method and invoke on exceptions --- module/alas.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/module/alas.py b/module/alas.py index 2dcc72b..25a80ab 100644 --- a/module/alas.py +++ b/module/alas.py @@ -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.