From cea810e3791df583be1cf3da4d924add78ed3a0a Mon Sep 17 00:00:00 2001 From: POLAR me Date: Mon, 30 Dec 2024 02:55:11 +0800 Subject: [PATCH] =?UTF-8?q?fix(alas):=20=E6=B7=BB=E5=8A=A0=E4=BA=86?= =?UTF-8?q?=E9=81=97=E6=BC=8F=E7=9A=84=E6=8D=95=E8=8E=B7=E5=BC=82=E5=B8=B8?= =?UTF-8?q?=E5=B9=B6=E5=8F=91=E9=80=81=E9=80=9A=E7=9F=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 在loop中添加异常捕获块,确保脚本在发生异常时能够发送通知(原先模拟器游戏死机的情况报错没得到推送) --- alas.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/alas.py b/alas.py index 1aee1d2f2..a3182b969 100644 --- a/alas.py +++ b/alas.py @@ -633,6 +633,15 @@ class AzurLaneAutoScript: content=f"<{self.config_name}> RequestHumanTakeover", ) exit(1) + except Exception as e: + logger.exception(e) + self.save_error_log() + handle_notify( + self.config.Error_OnePushConfig, + title=f"Alas <{self.config_name}> crashed", + content=f"<{self.config_name}> Exception occured", + ) + exit(1) self.config.task_delay(server_update=True) del_cached_property(self, 'config') continue