error.py 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637
  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