python
runtime_error
ai_generated
true
starlette.exceptions.HTTPException:404: 未找到
starlette.exceptions.HTTPException: 404: Not Found
ID: python/starlette-http-exception
80%修复率
88%置信度
0证据数
2024-07-15首次发现
版本兼容性
| 版本 | 状态 | 引入 | 弃用 | 备注 |
|---|---|---|---|---|
| 0.30.x | active | — | — | — |
| 0.40.x | active | — | — | — |
根因分析
未找到路由或资源;当没有匹配的路由时由 Starlette 引发。
English
A route or resource is not found; raised by Starlette when no matching route exists.
解决方案
-
95% 成功率
Check `app.routes` or the OpenAPI docs at /docs.
-
90% 成功率
app.include_router(router, prefix='/api/v1')
无效尝试
常见但无效的做法:
-
70% 失败
Masks the 404 but doesn't fix the missing route or typo.
-
90% 失败
Debug mode shows traceback but doesn't resolve missing route.