2023-05-15 08:51:32 +08:00
|
|
|
from libs.exception import BaseHTTPException
|
|
|
|
|
|
|
|
|
|
|
|
class RepeatPasswordNotMatchError(BaseHTTPException):
|
2024-08-26 15:29:10 +08:00
|
|
|
error_code = "repeat_password_not_match"
|
2023-05-15 08:51:32 +08:00
|
|
|
description = "New password and repeat password does not match."
|
|
|
|
code = 400
|
|
|
|
|
|
|
|
|
2023-07-14 11:19:26 +08:00
|
|
|
class CurrentPasswordIncorrectError(BaseHTTPException):
|
2024-08-26 15:29:10 +08:00
|
|
|
error_code = "current_password_incorrect"
|
2023-07-14 11:19:26 +08:00
|
|
|
description = "Current password is incorrect."
|
|
|
|
code = 400
|
|
|
|
|
|
|
|
|
2023-05-15 08:51:32 +08:00
|
|
|
class ProviderRequestFailedError(BaseHTTPException):
|
2024-08-26 15:29:10 +08:00
|
|
|
error_code = "provider_request_failed"
|
2023-05-15 08:51:32 +08:00
|
|
|
description = None
|
|
|
|
code = 400
|
|
|
|
|
|
|
|
|
|
|
|
class InvalidInvitationCodeError(BaseHTTPException):
|
2024-08-26 15:29:10 +08:00
|
|
|
error_code = "invalid_invitation_code"
|
2023-05-15 08:51:32 +08:00
|
|
|
description = "Invalid invitation code."
|
|
|
|
code = 400
|
|
|
|
|
|
|
|
|
|
|
|
class AccountAlreadyInitedError(BaseHTTPException):
|
2024-08-26 15:29:10 +08:00
|
|
|
error_code = "account_already_inited"
|
2023-05-22 17:39:28 +08:00
|
|
|
description = "The account has been initialized. Please refresh the page."
|
2023-05-15 08:51:32 +08:00
|
|
|
code = 400
|
|
|
|
|
|
|
|
|
|
|
|
class AccountNotInitializedError(BaseHTTPException):
|
2024-08-26 15:29:10 +08:00
|
|
|
error_code = "account_not_initialized"
|
2023-05-22 17:39:28 +08:00
|
|
|
description = "The account has not been initialized yet. Please proceed with the initialization process first."
|
2023-05-15 08:51:32 +08:00
|
|
|
code = 400
|
2024-12-29 22:33:42 -05:00
|
|
|
|
|
|
|
|
|
|
|
class InvalidAccountDeletionCodeError(BaseHTTPException):
|
|
|
|
error_code = "invalid_account_deletion_code"
|
|
|
|
description = "Invalid account deletion code."
|
|
|
|
code = 400
|