Skip to content

bug: no error handling on requests.post/delete calls — can crash RotorHazard #54

@agent01baarathi

Description

@agent01baarathi

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions