mirror of
https://github.com/fastapi-admin/fastapi-admin.git
synced 2025-08-14 10:47:30 +08:00
11 lines
305 B
Python
11 lines
305 B
Python
from starlette.requests import Request
|
|
from fastapi.exceptions import HTTPException
|
|
from starlette.responses import UJSONResponse
|
|
|
|
|
|
async def exception_handler(request: Request, exc: HTTPException):
|
|
return UJSONResponse(
|
|
status_code=exc.status_code,
|
|
content={'msg': exc.detail},
|
|
)
|