mirror of
https://github.com/fastapi-admin/fastapi-admin.git
synced 2025-08-15 03:04:37 +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},)
|