fix: list_collections 异常向上传播而非静默吞掉
This commit is contained in:
+5
-1
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user