mirror of
https://github.com/langgenius/dify.git
synced 2026-11-11 13:51:25 +08:00
130 lines
3.9 KiB
Python
130 lines
3.9 KiB
Python
from controllers import account_email_errors
|
|
from libs.exception import BaseHTTPException
|
|
|
|
AccountInFreezeError = account_email_errors.AccountInFreezeError
|
|
EmailDomainSuspendedError = account_email_errors.EmailDomainSuspendedError
|
|
EmailSendIpLimitError = account_email_errors.EmailSendIpLimitError
|
|
|
|
|
|
class PaidPlanRequiredError(BaseHTTPException):
|
|
error_code = "paid_plan_required"
|
|
description = "This feature requires a paid plan."
|
|
code = 403
|
|
|
|
|
|
class AlreadySetupError(BaseHTTPException):
|
|
error_code = "already_setup"
|
|
description = "Dify has been successfully installed. Please refresh the page or return to the dashboard homepage."
|
|
code = 403
|
|
|
|
|
|
class NotSetupError(BaseHTTPException):
|
|
error_code = "not_setup"
|
|
description = (
|
|
"Dify has not been initialized and installed yet. "
|
|
"Please proceed with the initialization and installation process first."
|
|
)
|
|
code = 401
|
|
|
|
|
|
class NotInitValidateError(BaseHTTPException):
|
|
error_code = "not_init_validated"
|
|
description = "Init validation has not been completed yet. Please proceed with the init validation process first."
|
|
code = 401
|
|
|
|
|
|
class InitValidateFailedError(BaseHTTPException):
|
|
error_code = "init_validate_failed"
|
|
description = "Init validation failed. Please check the password and try again."
|
|
code = 401
|
|
|
|
|
|
class AccountNotLinkTenantError(BaseHTTPException):
|
|
error_code = "account_not_link_tenant"
|
|
description = "Account not link tenant."
|
|
code = 403
|
|
|
|
|
|
class AlreadyActivateError(BaseHTTPException):
|
|
error_code = "already_activate"
|
|
description = "Auth Token is invalid or account already activated, please check again."
|
|
code = 403
|
|
|
|
|
|
class NotAllowedCreateWorkspace(BaseHTTPException):
|
|
error_code = "not_allowed_create_workspace"
|
|
description = "Workspace not found, please contact system admin to invite you to join in a workspace."
|
|
code = 400
|
|
|
|
|
|
class WorkspaceMembersLimitExceeded(BaseHTTPException):
|
|
error_code = "limit_exceeded"
|
|
description = "Unable to add member because the maximum workspace's member limit was exceeded"
|
|
code = 400
|
|
|
|
|
|
class WorkspacesLimitExceeded(BaseHTTPException):
|
|
error_code = "limit_exceeded"
|
|
description = "Unable to create workspace because the maximum workspace limit was exceeded"
|
|
code = 400
|
|
|
|
|
|
class SeatsLimitExceeded(BaseHTTPException):
|
|
error_code = "limit_exceeded"
|
|
description = "Unable to create account because the licensed seats limit was exceeded"
|
|
code = 400
|
|
|
|
|
|
class AccountBannedError(BaseHTTPException):
|
|
error_code = "account_banned"
|
|
description = "Account is banned."
|
|
code = 400
|
|
|
|
|
|
class AccountNotFound(BaseHTTPException):
|
|
error_code = "account_not_found"
|
|
description = "Account not found."
|
|
code = 400
|
|
|
|
|
|
class InvalidAccountPasswordRequestError(BaseHTTPException):
|
|
error_code = "invalid_account_password"
|
|
description = "The password does not satisfy the account password policy."
|
|
code = 400
|
|
|
|
|
|
class UnauthorizedAndForceLogout(BaseHTTPException):
|
|
error_code = "unauthorized_and_force_logout"
|
|
description = "Unauthorized and force logout."
|
|
code = 401
|
|
|
|
|
|
class EducationVerifyLimitError(BaseHTTPException):
|
|
error_code = "education_verify_limit"
|
|
description = "Rate limit exceeded"
|
|
code = 429
|
|
|
|
|
|
class EducationActivateLimitError(BaseHTTPException):
|
|
error_code = "education_activate_limit"
|
|
description = "Rate limit exceeded"
|
|
code = 429
|
|
|
|
|
|
class EducationVerifyFailedError(BaseHTTPException):
|
|
error_code = "education_verify_failed"
|
|
description = "We couldn't verify your education status."
|
|
code = 400
|
|
|
|
|
|
class EducationActivateFailedError(BaseHTTPException):
|
|
error_code = "education_activate_failed"
|
|
description = "We couldn't activate your education discount."
|
|
code = 400
|
|
|
|
|
|
class ApiKeyLimitExceededHTTPError(BaseHTTPException):
|
|
error_code = "max_keys_exceeded"
|
|
description = "The API key limit has been reached."
|
|
code = 400
|