mirror of
https://github.com/langgenius/dify.git
synced 2026-03-29 11:56:50 +00:00
Some checks failed
autofix.ci / autofix (push) Has been cancelled
Build and Push API & Web / build (api, DIFY_API_IMAGE_NAME, linux/amd64, build-api-amd64) (push) Has been cancelled
Build and Push API & Web / build (api, DIFY_API_IMAGE_NAME, linux/arm64, build-api-arm64) (push) Has been cancelled
Build and Push API & Web / build (web, DIFY_WEB_IMAGE_NAME, linux/amd64, build-web-amd64) (push) Has been cancelled
Build and Push API & Web / build (web, DIFY_WEB_IMAGE_NAME, linux/arm64, build-web-arm64) (push) Has been cancelled
Build and Push API & Web / create-manifest (api, DIFY_API_IMAGE_NAME, merge-api-images) (push) Has been cancelled
Build and Push API & Web / create-manifest (web, DIFY_WEB_IMAGE_NAME, merge-web-images) (push) Has been cancelled
Main CI Pipeline / Check Changed Files (push) Has been cancelled
Main CI Pipeline / API Tests (push) Has been cancelled
Main CI Pipeline / Web Tests (push) Has been cancelled
Main CI Pipeline / Style Check (push) Has been cancelled
Main CI Pipeline / VDB Tests (push) Has been cancelled
Main CI Pipeline / DB Migration Test (push) Has been cancelled
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
46 lines
1.3 KiB
Python
46 lines
1.3 KiB
Python
"""Enterprise service errors."""
|
|
|
|
from services.errors.base import BaseServiceError
|
|
|
|
|
|
class EnterpriseServiceError(BaseServiceError):
|
|
"""Base exception for enterprise service errors."""
|
|
|
|
def __init__(self, description: str | None = None, status_code: int | None = None):
|
|
super().__init__(description)
|
|
self.status_code = status_code
|
|
|
|
|
|
class EnterpriseAPIError(EnterpriseServiceError):
|
|
"""Generic enterprise API error (non-2xx response)."""
|
|
|
|
pass
|
|
|
|
|
|
class EnterpriseAPINotFoundError(EnterpriseServiceError):
|
|
"""Enterprise API returned 404 Not Found."""
|
|
|
|
def __init__(self, description: str | None = None):
|
|
super().__init__(description, status_code=404)
|
|
|
|
|
|
class EnterpriseAPIForbiddenError(EnterpriseServiceError):
|
|
"""Enterprise API returned 403 Forbidden."""
|
|
|
|
def __init__(self, description: str | None = None):
|
|
super().__init__(description, status_code=403)
|
|
|
|
|
|
class EnterpriseAPIUnauthorizedError(EnterpriseServiceError):
|
|
"""Enterprise API returned 401 Unauthorized."""
|
|
|
|
def __init__(self, description: str | None = None):
|
|
super().__init__(description, status_code=401)
|
|
|
|
|
|
class EnterpriseAPIBadRequestError(EnterpriseServiceError):
|
|
"""Enterprise API returned 400 Bad Request."""
|
|
|
|
def __init__(self, description: str | None = None):
|
|
super().__init__(description, status_code=400)
|