Spaces:
Running
Running
| from api_exception.exception import APIException | |
| from common.enum.ai_service_error import AiServiceError | |
| class Conflict(APIException): | |
| status_code = 409 | |
| default_detail = "Conflict" | |
| default_code = "conflict" | |
| class AiServiceException(APIException): | |
| status_code = 400 | |
| def __init__(self, ai_error_code: AiServiceError, detail=None, status_code=None): | |
| self.error_code = ai_error_code.value | |
| self.detail = detail if detail is not None else ai_error_code.value | |
| if status_code is not None: | |
| self.status_code = status_code | |
| super().__init__(detail=self.detail) | |