Skip to content

Commit

Permalink
Merge pull request #48 from Thymis-io/fix/startup-migration
Browse files Browse the repository at this point in the history
Catch subprocess error of migration at startup
  • Loading branch information
MSchmoecker authored Jul 5, 2024
2 parents 442263f + 042efbb commit 4546a56
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion controller/thymis_controller/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,11 @@ def __init__(self, path):
with open(state_path, "r", encoding="utf-8") as f:
state_dict = json.load(f)
state_dict = migration.migrate(state_dict)
self.write_state_and_reload(State.model_validate(state_dict))
try:
self.write_state_and_reload(State.model_validate(state_dict))
except subprocess.CalledProcessError as e:
logger.error("Error while migrating state: %s", e)
traceback.print_exc()

def read_state(self):
with open(Path(self.path) / "state.json", "r", encoding="utf-8") as f:
Expand Down

0 comments on commit 4546a56

Please sign in to comment.