fix(simulation): catch FileNotFoundError in patch_agent endpoint (return 404 not 500)

This commit is contained in:
Ubuntu 2026-05-03 21:40:16 +00:00
parent f7dd353a31
commit c0356e706a
1 changed files with 2 additions and 0 deletions

View File

@ -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: