Problem
All API calls in cloudlink.py (resync_new, class_listener, class_heat_delete, heat_listener, laptime_listener, results_listener) use bare requests.post() / requests.delete() with no try/except.
isConnected() only guards against full network failures — it won't catch a server-side 500, a timeout, or a malformed response. Any of these will throw an unhandled exception mid-race and potentially crash RotorHazard.
Fix
Wrap all API calls in try/except, e.g.:
try:
x = requests.post(self.CL_API_ENDPOINT + "/resync", json=payload, timeout=10)
x.raise_for_status()
except requests.RequestException as e:
self.logger.error(f"CloudLink resync failed: {e}")
Impact
- Unhandled exception on API failure during live race
- Potential RotorHazard crash/freeze