from starlette import status from starlette.requests import Request from starlette.responses import JSONResponse, Response async def default_error_handler(request: Request, exc: Exception) -> Response: return JSONResponse( content={ "code": "internal_error", "message": ( "The server encountered an internal error " "and was unable to complete your request." ), }, status_code=status.HTTP_500_INTERNAL_SERVER_ERROR, )