{
  "id": "python/fastapi-http-exception-detail-not-serializable",
  "signature": "TypeError: Object of type ValueError is not JSON serializable",
  "signature_zh": "TypeError: ValueError 类型的对象不可 JSON 序列化",
  "regex": "TypeError:\\ Object\\ of\\ type\\ ValueError\\ is\\ not\\ JSON\\ serializable",
  "domain": "python",
  "category": "type_error",
  "subcategory": null,
  "root_cause": "HTTPException detail was passed a non-serializable object (e.g. an exception) instead of a string or dict.",
  "root_cause_type": "generic",
  "root_cause_zh": "HTTPException 的 detail 传入了不可序列化的对象（如异常实例），而不是字符串或字典。",
  "versions": [
    {
      "version": "3.x",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "Loses error context and clients get an empty body.",
      "fail_rate": 0.7,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Leaks internals and is fragile across exception types.",
      "fail_rate": 0.8,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "",
      "success_rate": 0.95,
      "how": "raise HTTPException(status_code=400, detail=str(e))",
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "success_rate": 0.9,
      "how": "raise HTTPException(400, detail={'error': 'bad_input', 'message': str(e)})",
      "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": "2024-10-30",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}