mirror of
https://github.com/fastapi-admin/fastapi-admin.git
synced 2026-03-13 10:32:25 +08:00
8 lines
281 B
Python
8 lines
281 B
Python
from fastapi.exceptions import HTTPException
|
|
from starlette.requests import Request
|
|
from starlette.responses import JSONResponse
|
|
|
|
|
|
async def exception_handler(request: Request, exc: HTTPException):
|
|
return JSONResponse(status_code=exc.status_code, content={"msg": exc.detail},)
|