{
  "id": "python/starlette-runtimeerror-no-response-returned",
  "signature": "RuntimeError: No response returned.",
  "signature_zh": "RuntimeError: 未返回响应。",
  "regex": "RuntimeError:\\ No\\ response\\ returned\\.",
  "domain": "python",
  "category": "runtime_error",
  "subcategory": null,
  "root_cause": "An ASGI middleware or endpoint returns None instead of a Response, or an exception is swallowed inside a BaseHTTPMiddleware dispatch.",
  "root_cause_type": "generic",
  "root_cause_zh": "ASGI 中间件或端点返回 None 而非 Response，或异常在 BaseHTTPMiddleware 的 dispatch 中被吞掉。",
  "versions": [
    {
      "version": "3.x",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "Hides the original exception and breaks streaming responses.",
      "fail_rate": 0.75,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Behavior persists across versions; root cause is the middleware logic.",
      "fail_rate": 0.8,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "",
      "success_rate": 0.93,
      "how": "class M(BaseHTTPMiddleware):\n    async def dispatch(self, request, call_next):\n        response = await call_next(request)\n        return response",
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "success_rate": 0.9,
      "how": "try:\n    response = await call_next(request)\nexcept Exception:\n    raise",
      "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.84,
  "fix_success_rate": 0.8,
  "resolvable": "true",
  "first_seen": "2024-09-15",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}