feat:增加Elasticsearch功能

This commit is contained in:
2025-09-24 20:04:23 +08:00
parent 842da15886
commit ef938e6d97
5 changed files with 105 additions and 3 deletions

View File

@@ -35,13 +35,13 @@ async def global_exception_handler(request: Request, call_next):
except SQLAlchemyError as e:
# 记录数据库异常
#logger.critical(f"数据库异常: {str(e)}", exc_info=True)
logger.critical(f"数据库异常: {str(e)}", exc_info=True)
return JSONResponse(status_code=status.HTTP_500_INTERNAL_SERVER_ERROR,
content={"message": "数据库操作失败", "details": str(e)})
except Exception as e:
# 记录未知异常(带堆栈信息)
#logger.critical(f"未知异常: {str(e)}", exc_info=True)
logger.critical(f"未知异常: {str(e)}", exc_info=True)
return JSONResponse(status_code=status.HTTP_500_INTERNAL_SERVER_ERROR,
content={"code": 500, "message": "服务器内部错误", "details": str(e)})