Skip to content

Commit 439ec5c

Browse files
fix: skip corrupted run state files in list_runs
1 parent 186ca25 commit 439ec5c

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

‎src/specify_cli/workflows/engine.py‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1583,8 +1583,11 @@ def list_runs(self) -> list[dict[str, Any]]:
15831583
continue
15841584
state_path = run_dir / "state.json"
15851585
if state_path.exists():
1586-
with open(state_path, encoding="utf-8") as f:
1587-
state_data = json.load(f)
1586+
try:
1587+
with open(state_path, encoding="utf-8") as f:
1588+
state_data = json.load(f)
1589+
except (json.JSONDecodeError, OSError):
1590+
continue
15881591
runs.append(state_data)
15891592
return runs
15901593

0 commit comments

Comments
 (0)