HKUDS/Vibe-Trading · error · EtoroAPIError

request failed without response

Error message

request failed without response

What it means

Raised by EtoroClient.request when the retry loop ended without any response and without any captured exception — a defensive sentinel for an impossible/degenerate state (e.g. zero iterations or a handler that swallowed the error).

Source

Thrown at agent/src/trading/connectors/etoro/client.py:343

                retry_after = response.headers.get("Retry-After")
                delay = float(retry_after) if retry_after else backoff[min(attempt, len(backoff) - 1)]
                time.sleep(delay)
                continue

            if response.status_code >= 400:
                detail = _response_error_body(response)
                raise EtoroAPIError(f"HTTP {response.status_code}: {detail}")

            if not response.content:
                return {}
            try:
                return response.json()
            except ValueError as exc:
                raise EtoroAPIError(f"invalid JSON response: {exc}") from exc

        if last_exc is not None:
            raise EtoroAPIError(f"network error: {last_exc}")
        raise EtoroAPIError("request failed without response")


def _build_default_client(cfg: EtoroConfig) -> EtoroClient:
    """Build the production HTTP client for one eToro configuration."""
    return EtoroClient(cfg)


_default_client_factory: Callable[[EtoroConfig], EtoroClient] = _build_default_client


def make_client(cfg: EtoroConfig) -> EtoroClient:
    """Build the REST client for a config (tests may override via ``set_client_factory``)."""
    return _default_client_factory(cfg)


def set_client_factory(
    factory: Callable[[EtoroConfig], EtoroClient] | None = None,
) -> None:

View on GitHub (pinned to 80ffdda44c)

Solutions

  1. Check the retry-loop configuration (attempts must be >= 1)
  2. Report as a bug in the client if reached with stock configuration
  3. Add logging around the retry loop to see which path was taken
Defensive patterns

Strategy: try-catch

Try / catch

try:
    resp = client.request('GET', path)
except EtoroAPIError as exc:
    if 'without response' in str(exc):
        report_bug_to_client_maintainer()
    raise

Prevention

When it happens

Trigger: Extremely rare: misconfigured retry count of 0, or an exception path that does not record last_exc. In practice, treat as an internal invariant failure rather than an environmental one.

Common situations: Custom subclass or monkeypatched transport that returns without raising or producing a response; edge-case in retry loop logic.

Related errors


AI-assisted analysis of HKUDS/Vibe-Trading@80ffdda44c (2026-08-28). Data as JSON: /api/errors/2e5b8a5067d70640. Report an issue: GitHub.