aboutsummaryrefslogtreecommitdiff
path: root/modules/config_states.py
diff options
context:
space:
mode:
authorw-e-w <40751091+w-e-w@users.noreply.github.com>2023-08-20 16:13:26 +0900
committerw-e-w <40751091+w-e-w@users.noreply.github.com>2023-08-20 18:48:23 +0900
commite0e64bcdf606b0c5f0e543b53f7e63a94ec325de (patch)
treee766653bfe6142a23cea8874abe5f867c52543e5 /modules/config_states.py
parent36ecff71aea2c9c9f296ae1e0b5da00a3aea26d3 (diff)
assert key created_at exist in config_states
Diffstat (limited to 'modules/config_states.py')
-rw-r--r--modules/config_states.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/modules/config_states.py b/modules/config_states.py
index 62d40106..331c7b90 100644
--- a/modules/config_states.py
+++ b/modules/config_states.py
@@ -31,10 +31,11 @@ def list_config_states():
try:
with open(path, "r", encoding="utf-8") as f:
j = json.load(f)
+ assert "created_at" in j, '"created_at" does not exist'
j["filepath"] = path
config_states.append(j)
except Exception as e:
- print(f'[ERROR]{path}, {e}')
+ print(f'[ERROR]: Config states {path}, {e}')
config_states = sorted(config_states, key=lambda cs: cs["created_at"], reverse=True)