From 3756351ed9ca158c33a4f1f833f866fe42279a18 Mon Sep 17 00:00:00 2001 From: Jean-Marie Mineau Date: Wed, 21 May 2025 17:38:16 +0200 Subject: [PATCH] handle invalid json --- experiment/orchestrator.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/experiment/orchestrator.py b/experiment/orchestrator.py index 86f3a79..8c286ad 100644 --- a/experiment/orchestrator.py +++ b/experiment/orchestrator.py @@ -253,8 +253,11 @@ def worker(emu: str, apklist: queue.Queue[str], out_folder: Path, script: Path): if folder.exists() and (folder / "data.json").exists(): has_error = False with (folder / "data.json").open() as fp: - data = json.load(fp) - if "error" in data: + try: + data = json.load(fp) + if "error" in data: + has_error = True + except json.JSONDecodeError: has_error = True if (folder / "TIMEOUT").exists(): has_error = True