{
  "id": "python/starlette-http-exception-404",
  "signature": "starlette.exceptions.HTTPException: 404 Not Found",
  "signature_zh": "Starlette HTTP异常：404 未找到",
  "regex": "starlette\\.exceptions\\.HTTPException:\\ 404\\ Not\\ Found",
  "domain": "python",
  "category": "runtime_error",
  "subcategory": null,
  "root_cause": "A route is not defined for the requested URL, or the URL is incorrect due to routing mismatches.",
  "root_cause_type": "generic",
  "root_cause_zh": "请求的URL没有定义路由，或由于路由不匹配导致URL错误。",
  "versions": [
    {
      "version": "3.x",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "Catching all HTTPExceptions and returning a custom page can mask other errors like 500s.",
      "fail_rate": 0.5,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Using regex patterns incorrectly in route paths can cause unexpected 404s.",
      "fail_rate": 0.7,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "",
      "success_rate": 0.9,
      "how": "Check app.routes to see registered routes and ensure the path matches exactly, including trailing slashes.",
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "success_rate": 0.8,
      "how": "Add a catch-all route: @app.route('/{path:path}')\\nasync def catch_all(request):\\n    raise HTTPException(status_code=404)",
      "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.82,
  "fix_success_rate": 0.8,
  "resolvable": "true",
  "first_seen": "2024-05-10",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}