{"record":{"id":"f3a09ccb89cf52d8","repo":"infiniflow/ragflow","slug":"status-resp-status-response-text","errorCode":null,"errorMessage":"status: {resp.status}, response: {text}","messagePattern":"status: (.+?), response: (.+?)","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"api/channels/whatsapp/channel.py","lineNumber":124,"sourceCode":"        return self._http_session\n\n    async def _request_json(\n        self,\n        method: str,\n        path: str,\n        payload: dict[str, Any] | None = None,\n    ) -> dict[str, Any]:\n        session = await self._ensure_http_session()\n        url = self._gateway_url(path)\n        async with session.request(\n            method,\n            url,\n            json=payload,\n            headers=self._gateway_headers(),\n        ) as resp:\n            text = await resp.text()\n            if resp.status >= 400:\n                raise RuntimeError(f\"status: {resp.status}, response: {text}\")\n            if not text.strip():\n                return {}\n            content_type = resp.headers.get(\"content-type\", \"\")\n            if \"application/json\" not in content_type.lower():\n                raise RuntimeError(f\"unexpected response content-type: {content_type or 'unknown'}, response: {text[:200]}\")\n            try:\n                return await resp.json()\n            except Exception as ex:\n                raise RuntimeError(f\"invalid json response: {text[:200]}\") from ex\n\n    async def _request_json_with_retry(\n        self,\n        method: str,\n        path: str,\n        payload: dict[str, Any] | None = None,\n    ) -> dict[str, Any]:\n        deadline = time.time() + WHATSAPP_GATEWAY_START_RETRY_SECS\n        last_error: Exception | None = None","sourceCodeStart":106,"sourceCodeEnd":142,"githubUrl":"https://github.com/infiniflow/ragflow/blob/554fb1133ac3861732235ad9c377eb5e0a770665/api/channels/whatsapp/channel.py#L106-L142","documentation":"Error \"status: {resp.status}, response: {text}\" thrown in infiniflow/ragflow.","triggerScenarios":"Thrown at api/channels/whatsapp/channel.py:124 when the library encounters an invalid state.","commonSituations":"The WhatsApp gateway returns a non-success HTTP status, often from an invalid session or payload; checking the gateway logs prevents this error.","solutions":["Inspect the gateway response status and body for details.","Verify the gateway is running and the request payload matches its API."],"exampleFix":"if resp.status != 200:\n    text = await resp.text()\n    raise Exception(f'status: {resp.status}, response: {text}')","handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"554fb1133ac3861732235ad9c377eb5e0a770665","analyzedAt":"2026-08-15T09:20:16.380Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}