# starlette.exceptions.HTTPException：404: 未找到

- **ID:** `python/starlette-http-exception`
- **领域:** python
- **类别:** runtime_error
- **验证级别:** ai_generated
- **修复率:** 80%

## 根因

未找到路由或资源；当没有匹配的路由时由 Starlette 引发。

## 版本兼容性

| 版本 | 状态 | 引入 | 弃用 |
|------|------|------|------|
| 0.30.x | active | — | — |
| 0.40.x | active | — | — |

## 解决方案

1. **** (95% 成功率)
   ```
   Check `app.routes` or the OpenAPI docs at /docs.
   ```
2. **** (90% 成功率)
   ```
   app.include_router(router, prefix='/api/v1')
   ```

## 无效尝试

- **** — Masks the 404 but doesn't fix the missing route or typo. (70% 失败率)
- **** — Debug mode shows traceback but doesn't resolve missing route. (90% 失败率)
