error.py 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. from libs.exception import BaseHTTPException
  2. class RepeatPasswordNotMatchError(BaseHTTPException):
  3. error_code = "repeat_password_not_match"
  4. description = "New password and repeat password does not match."
  5. code = 400
  6. class CurrentPasswordIncorrectError(BaseHTTPException):
  7. error_code = "current_password_incorrect"
  8. description = "Current password is incorrect."
  9. code = 400
  10. class ProviderRequestFailedError(BaseHTTPException):
  11. error_code = "provider_request_failed"
  12. description = None
  13. code = 400
  14. class InvalidInvitationCodeError(BaseHTTPException):
  15. error_code = "invalid_invitation_code"
  16. description = "Invalid invitation code."
  17. code = 400
  18. class AccountAlreadyInitedError(BaseHTTPException):
  19. error_code = "account_already_inited"
  20. description = "The account has been initialized. Please refresh the page."
  21. code = 400
  22. class AccountNotInitializedError(BaseHTTPException):
  23. error_code = "account_not_initialized"
  24. description = "The account has not been initialized yet. Please proceed with the initialization process first."
  25. code = 400
  26. class InvalidAccountDeletionCodeError(BaseHTTPException):
  27. error_code = "invalid_account_deletion_code"
  28. description = "Invalid account deletion code."
  29. code = 400