error.py 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. from libs.exception import BaseHTTPException
  2. class AlreadySetupError(BaseHTTPException):
  3. error_code = "already_setup"
  4. description = "Dify has been successfully installed. Please refresh the page or return to the dashboard homepage."
  5. code = 403
  6. class NotSetupError(BaseHTTPException):
  7. error_code = "not_setup"
  8. description = (
  9. "Dify has not been initialized and installed yet. "
  10. "Please proceed with the initialization and installation process first."
  11. )
  12. code = 401
  13. class NotInitValidateError(BaseHTTPException):
  14. error_code = "not_init_validated"
  15. description = (
  16. "Init validation has not been completed yet. " "Please proceed with the init validation process first."
  17. )
  18. code = 401
  19. class InitValidateFailedError(BaseHTTPException):
  20. error_code = "init_validate_failed"
  21. description = "Init validation failed. Please check the password and try again."
  22. code = 401
  23. class AccountNotLinkTenantError(BaseHTTPException):
  24. error_code = "account_not_link_tenant"
  25. description = "Account not link tenant."
  26. code = 403
  27. class AlreadyActivateError(BaseHTTPException):
  28. error_code = "already_activate"
  29. description = "Auth Token is invalid or account already activated, please check again."
  30. code = 403