# TypeError: Object of type ValueError is not JSON serializable

- **ID:** `python/fastapi-http-exception-detail-not-serializable`
- **Domain:** python
- **Category:** type_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

HTTPException detail was passed a non-serializable object (e.g. an exception) instead of a string or dict.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| 3.x | active | — | — |

## Workarounds

1. **** (95% success)
   ```
   raise HTTPException(status_code=400, detail=str(e))
   ```
2. **** (90% success)
   ```
   raise HTTPException(400, detail={'error': 'bad_input', 'message': str(e)})
   ```

## Dead Ends

- **** — Loses error context and clients get an empty body. (70% fail)
- **** — Leaks internals and is fragile across exception types. (80% fail)
