This commit is contained in:
aaron 2025-03-01 09:26:39 +08:00
parent 80ce826884
commit 22fb08795a

View File

@ -88,7 +88,9 @@ async def health_check():
@app.exception_handler(Exception) @app.exception_handler(Exception)
async def exception_handler(request, exc): async def exception_handler(request, exc):
logging.exception(f"API异常: {str(exc)}") env = "测试环境" if settings.DEBUG else "生产环境"
logging.exception(f"{env}】API异常: {str(exc)}")
# 发送企业微信消息 # 发送企业微信消息
wecom_bot = WecomBot(settings.URL_WECOMBOT_SYS_EXCEPTION) wecom_bot = WecomBot(settings.URL_WECOMBOT_SYS_EXCEPTION)