FastAPI - Error Handling
What is the issue with this FastAPI custom exception handler registration?
from fastapi import FastAPI, Request
app = FastAPI()
class CustomException(Exception):
pass
@app.exception_handler(CustomException)
async def custom_handler(request: Request):
return {"message": "Error occurred"}