From e0e64bcdf606b0c5f0e543b53f7e63a94ec325de Mon Sep 17 00:00:00 2001 From: w-e-w <40751091+w-e-w@users.noreply.github.com> Date: Sun, 20 Aug 2023 16:13:26 +0900 Subject: [PATCH] assert key created_at exist in config_states --- modules/config_states.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/config_states.py b/modules/config_states.py index 62d40106a..331c7b90e 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)