error.py 1.3 KB

123456789101112131415161718192021222324252627282930313233343536
  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 = "Dify has not been initialized and installed yet. " \
  9. "Please proceed with the initialization and installation process first."
  10. code = 401
  11. class NotInitValidateError(BaseHTTPException):
  12. error_code = 'not_init_validated'
  13. description = "Init validation has not been completed yet. " \
  14. "Please proceed with the init validation process first."
  15. code = 401
  16. class InitValidateFailedError(BaseHTTPException):
  17. error_code = 'init_validate_failed'
  18. description = "Init validation failed. Please check the password and try again."
  19. code = 401
  20. class AccountNotLinkTenantError(BaseHTTPException):
  21. error_code = 'account_not_link_tenant'
  22. description = "Account not link tenant."
  23. code = 403
  24. class AlreadyActivateError(BaseHTTPException):
  25. error_code = 'already_activate'
  26. description = "Auth Token is invalid or account already activated, please check again."
  27. code = 403