项目基础模块代码

This commit is contained in:
2025-02-19 11:47:33 +08:00
parent 3cb2a4c507
commit 31302bcd17
30 changed files with 588 additions and 74 deletions

View File

@ -0,0 +1,10 @@
from fastapi import HTTPException, Request
from app.common.reponse_code import response_error
from app import my_app
"""全局异常处理"""
@my_app.exception_handlers(HTTPException)
async def http_exception(request: Request, he: HTTPException):
return response_error(request.url + "出现异常:" + he.detail)