File size: 339 Bytes
51a7f02
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
from fastapi import FastAPI, UploadFile, File, HTTPException, Request
from fastapi.responses import JSONResponse
from typing import Any, Dict

async def generic_exception_handler(request: Request, exc: Exception) -> JSONResponse:
    return JSONResponse(
        status_code=500,
        content={"message": "Internal server error"},
    )