{
  "id": "python/starlette-jsondecodeerror",
  "signature": "starlette.requests.ClientDisconnect: Client disconnected",
  "signature_zh": "starlette.requests.ClientDisconnect：客户端断开连接",
  "regex": "starlette\\.requests\\.ClientDisconnect:\\ Client\\ disconnected",
  "domain": "python",
  "category": "network_error",
  "subcategory": null,
  "root_cause": "The client closed the connection before the server could read the full request body.",
  "root_cause_type": "generic",
  "root_cause_zh": "客户端在服务器读取完整请求体之前关闭了连接。",
  "versions": [
    {
      "version": "0.30.x",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "0.40.x",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "Client already disconnected; timeout doesn't help.",
      "fail_rate": 0.8,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "May cause duplicate operations if not idempotent.",
      "fail_rate": 0.6,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "",
      "success_rate": 0.9,
      "how": "try:\n    await request.json()\nexcept ClientDisconnect:\n    return JSONResponse(status_code=499, content={'detail': 'Client disconnected'})",
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "success_rate": 0.85,
      "how": "async for chunk in request.stream():\n    if await request.is_disconnected():\n        break",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": null,
  "official_doc_section": null,
  "error_code": null,
  "verification_tier": "ai_generated",
  "confidence": 0.86,
  "fix_success_rate": 0.8,
  "resolvable": "true",
  "first_seen": "2025-03-15",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}