From c0356e706a89d7f335c56f68cc40a1cd44e20f71 Mon Sep 17 00:00:00 2001 From: Ubuntu Date: Sun, 3 May 2026 21:40:16 +0000 Subject: [PATCH] fix(simulation): catch FileNotFoundError in patch_agent endpoint (return 404 not 500) --- backend/app/api/simulation.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/backend/app/api/simulation.py b/backend/app/api/simulation.py index d63cc15b..0b38fbf2 100644 --- a/backend/app/api/simulation.py +++ b/backend/app/api/simulation.py @@ -2721,6 +2721,8 @@ def patch_agent(simulation_id: str, user_id: int): return jsonify({"success": False, "error": str(e)}), 403 except LookupError as e: return jsonify({"success": False, "error": str(e)}), 404 + except FileNotFoundError as e: + return jsonify({"success": False, "error": str(e)}), 404 return jsonify({"success": True, "data": updated}) except Exception as e: