from fastapi import HTTPException class BusinessException(HTTPException): def __init__(self, error_code: str, message: str): super().__init__( status_code=400, detail={ "error_code": error_code, "message": message } )