fix: list_collections 异常向上传播而非静默吞掉

This commit is contained in:
2026-07-10 15:28:03 +08:00
parent 3308636086
commit 2e95f68864
4 changed files with 9 additions and 8 deletions
+5 -1
View File
@@ -106,7 +106,11 @@ def list_collections(
state: AppState = Depends(get_state),
_: bool = Depends(verify_api_key),
):
return {"collections": state.list_collections_with_stats()}
try:
return {"collections": state.list_collections_with_stats()}
except Exception:
logger.exception("列出集合失败")
raise HTTPException(status_code=500, detail="服务器内部错误")
@app.post("/api/v1/ingest")