Opt: Handler GamePageUnknownError when server is under maintenance

This commit is contained in:
Horizon101011 2022-07-21 10:20:28 +08:00
parent aa4d7b4b08
commit 70f1a68e94

12
alas.py
View File

@ -85,9 +85,15 @@ class AzurLaneAutoScript:
self.device.sleep(10)
return False
except GamePageUnknownError:
logger.critical('Game page unknown')
self.save_error_log()
exit(1)
logger.info('Game server may be under maintenance, check server status now')
self.checker.check_now()
if self.checker.is_available():
logger.critical('Game page unknown')
self.save_error_log()
exit(1)
else:
self.checker.wait_until_available()
return False
except ScriptError as e:
logger.critical(e)
logger.critical('This is likely to be a mistake of developers, but sometimes just random issues')