mirror of
https://github.com/LmeSzinc/AzurLaneAutoScript.git
synced 2025-01-08 12:27:33 +08:00
Opt: Catch and show exception when load config
This commit is contained in:
parent
d2d23345d0
commit
ddecb1ce57
12
alas.py
12
alas.py
@ -21,10 +21,14 @@ class AzurLaneAutoScript:
|
||||
|
||||
@cached_property
|
||||
def config(self):
|
||||
config = AzurLaneConfig(config_name=self.config_name)
|
||||
# Set server before loading any buttons.
|
||||
server.server = deep_get(config.data, keys='Alas.Emulator.Server', default='cn')
|
||||
return config
|
||||
try:
|
||||
config = AzurLaneConfig(config_name=self.config_name)
|
||||
# Set server before loading any buttons.
|
||||
server.server = deep_get(config.data, keys='Alas.Emulator.Server', default='cn')
|
||||
return config
|
||||
except Exception as e:
|
||||
logger.exception(e)
|
||||
exit(1)
|
||||
|
||||
@cached_property
|
||||
def device(self):
|
||||
|
@ -132,7 +132,11 @@ class TaskHandler:
|
||||
task = self.tasks[0]
|
||||
if task.next_run < time.time():
|
||||
start_time = time.time()
|
||||
next(task)
|
||||
try:
|
||||
next(task)
|
||||
except Exception as e:
|
||||
logger.exception(e)
|
||||
self.remove_task(task, nowait=True)
|
||||
end_time = time.time()
|
||||
task.next_run += task.delay
|
||||
with self._lock:
|
||||
|
Loading…
Reference in New Issue
Block a user