mirror of
https://github.com/langgenius/dify.git
synced 2026-11-11 05:41:09 +08:00
Co-authored-by: zxhlyh <jasonapring2015@outlook.com> Co-authored-by: JzoNg <jzongcode@gmail.com> Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
106 lines
2.9 KiB
Python
106 lines
2.9 KiB
Python
from http import HTTPStatus
|
|
|
|
from libs.exception import BaseHTTPException
|
|
|
|
|
|
class CurrentWorkspaceArchivedError(BaseHTTPException):
|
|
error_code = "current_workspace_archived"
|
|
description = "The current workspace has been archived."
|
|
code = 409
|
|
|
|
|
|
class RepeatPasswordNotMatchError(BaseHTTPException):
|
|
error_code = "repeat_password_not_match"
|
|
description = "New password and repeat password does not match."
|
|
code = 400
|
|
|
|
|
|
class CurrentPasswordIncorrectError(BaseHTTPException):
|
|
error_code = "current_password_incorrect"
|
|
description = "Current password is incorrect."
|
|
code = 400
|
|
|
|
|
|
class InvalidInvitationCodeError(BaseHTTPException):
|
|
error_code = "invalid_invitation_code"
|
|
description = "Invalid invitation code."
|
|
code = 400
|
|
|
|
|
|
class MissingInvitationCodeRequestError(BaseHTTPException):
|
|
error_code = "missing_invitation_code"
|
|
description = "Invitation code is required."
|
|
code = 400
|
|
|
|
|
|
class AccountAlreadyInitedError(BaseHTTPException):
|
|
error_code = "account_already_inited"
|
|
description = "The account has been initialized. Please refresh the page."
|
|
code = 400
|
|
|
|
|
|
class AccountNotInitializedError(BaseHTTPException):
|
|
error_code = "account_not_initialized"
|
|
description = "The account has not been initialized yet. Please proceed with the initialization process first."
|
|
code = 400
|
|
|
|
|
|
class InvalidAccountDeletionCodeError(BaseHTTPException):
|
|
error_code = "invalid_account_deletion_code"
|
|
description = "Invalid account deletion code."
|
|
code = 400
|
|
|
|
|
|
class InvalidMemberRoleError(BaseHTTPException):
|
|
error_code = "invalid_role"
|
|
description = "Invalid role."
|
|
code = 400
|
|
|
|
|
|
class IMBindingReadOnlyError(BaseHTTPException):
|
|
error_code = "im_binding_read_only"
|
|
description = "Centrally managed IM bindings cannot be edited from a workspace."
|
|
code = HTTPStatus.FORBIDDEN
|
|
|
|
|
|
class WorkspaceIMOverrideNotAllowedError(BaseHTTPException):
|
|
error_code = "workspace_im_override_not_allowed"
|
|
description = "Workspace IM overrides require centrally managed bindings."
|
|
code = HTTPStatus.FORBIDDEN
|
|
|
|
|
|
class PluginOperationError(BaseHTTPException):
|
|
error_code = "plugin_error"
|
|
description = "Plugin operation failed."
|
|
code = 400
|
|
|
|
|
|
class SkillRequestError(BaseHTTPException):
|
|
error_code = "invalid_request"
|
|
description = "Invalid skill request."
|
|
code = 400
|
|
|
|
|
|
class SkillFilenameMissingError(BaseHTTPException):
|
|
error_code = "filename_missing"
|
|
description = "filename is required"
|
|
code = 400
|
|
|
|
|
|
class MemberCannotOperateSelfError(BaseHTTPException):
|
|
error_code = "cannot_operate_self"
|
|
description = "Cannot operate on yourself."
|
|
code = 400
|
|
|
|
|
|
class MemberNotFoundError(BaseHTTPException):
|
|
error_code = "member_not_found"
|
|
description = "Member not found."
|
|
code = 404
|
|
|
|
|
|
class MemberRoleAlreadyAssignedError(BaseHTTPException):
|
|
error_code = "role_already_assigned"
|
|
description = "Role already assigned."
|
|
code = 400
|