{"record":{"id":"2e5b8a5067d70640","repo":"HKUDS/Vibe-Trading","slug":"request-failed-without-response","errorCode":null,"errorMessage":"request failed without response","messagePattern":"request failed without response","errorType":"exception","errorClass":"EtoroAPIError","httpStatus":null,"severity":"error","filePath":"agent/src/trading/connectors/etoro/client.py","lineNumber":343,"sourceCode":"                retry_after = response.headers.get(\"Retry-After\")\n                delay = float(retry_after) if retry_after else backoff[min(attempt, len(backoff) - 1)]\n                time.sleep(delay)\n                continue\n\n            if response.status_code >= 400:\n                detail = _response_error_body(response)\n                raise EtoroAPIError(f\"HTTP {response.status_code}: {detail}\")\n\n            if not response.content:\n                return {}\n            try:\n                return response.json()\n            except ValueError as exc:\n                raise EtoroAPIError(f\"invalid JSON response: {exc}\") from exc\n\n        if last_exc is not None:\n            raise EtoroAPIError(f\"network error: {last_exc}\")\n        raise EtoroAPIError(\"request failed without response\")\n\n\ndef _build_default_client(cfg: EtoroConfig) -> EtoroClient:\n    \"\"\"Build the production HTTP client for one eToro configuration.\"\"\"\n    return EtoroClient(cfg)\n\n\n_default_client_factory: Callable[[EtoroConfig], EtoroClient] = _build_default_client\n\n\ndef make_client(cfg: EtoroConfig) -> EtoroClient:\n    \"\"\"Build the REST client for a config (tests may override via ``set_client_factory``).\"\"\"\n    return _default_client_factory(cfg)\n\n\ndef set_client_factory(\n    factory: Callable[[EtoroConfig], EtoroClient] | None = None,\n) -> None:","sourceCodeStart":325,"sourceCodeEnd":361,"githubUrl":"https://github.com/HKUDS/Vibe-Trading/blob/80ffdda44c5c4db0dd84d70e051cca591cea67df/agent/src/trading/connectors/etoro/client.py#L325-L361","documentation":"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).","triggerScenarios":"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.","commonSituations":"Custom subclass or monkeypatched transport that returns without raising or producing a response; edge-case in retry loop logic.","solutions":["Check the retry-loop configuration (attempts must be >= 1)","Report as a bug in the client if reached with stock configuration","Add logging around the retry loop to see which path was taken"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try:\n    resp = client.request('GET', path)\nexcept EtoroAPIError as exc:\n    if 'without response' in str(exc):\n        report_bug_to_client_maintainer()\n    raise","preventionTips":["Don't customize retry loop parameters to zero attempts","Report occurrences upstream — this path should be unreachable"],"tags":["etoro","http","invariant"],"backgroundTag":"empty-http-response","analyzedSha":"80ffdda44c5c4db0dd84d70e051cca591cea67df","analyzedAt":"2026-08-28T12:46:38.989Z","schemaVersion":2},"datasetVersion":"2026-08-28T16:17:29.566Z"}