RAGFlow is an agent-native database: a Retrieval-Augmented Generation (RAG) engine that grew into context infrastructure.
Go agent-harnessagent-native-databaseagentic-aiagentic-retrievalagentic-searchaiai-agentscontext-enginecontext-engineeringcontext-managementharness-engineeringknowledge-compilationragretrieval-augmented-generationretrieval-harnesssearch-harness
Refactor: fix admin exception (#10400)
Jin Haief0aecea3b52
diff --git a/admin/services.py b/admin/services.pyindex ec98b10c53..2c8eaaf7cb 100644--- a/admin/services.py+++ b/admin/services.py@@ -8,6 +8,7 @@ from api.db.services.user_service import TenantServicefrom api.db.services.knowledgebase_service import KnowledgebaseServicefrom api.utils.crypt import decryptfrom api.utils import health_utils+from api.common.exceptions import AdminException, UserAlreadyExistsError, UserNotFoundErrorfrom config import SERVICE_CONFIGSdiff --git a/api/common/exceptions.py b/api/common/exceptions.pyindex 5e3021b418..5ce0e0bc21 100644--- a/api/common/exceptions.py+++ b/api/common/exceptions.py@@ -1,17 +1,21 @@class AdminException(Exception):def __init__(self, message, code=400):super().__init__(message)+ self.type = "admin"self.code = codeself.message = message+class UserNotFoundError(AdminException):def __init__(self, username):super().__init__(f"User '{username}' not found", 404)+class UserAlreadyExistsError(AdminException):def __init__(self, username):super().__init__(f"User '{username}' already exists", 409)+class CannotDeleteAdminError(AdminException):def __init__(self):super().__init__("Cannot delete admin account", 403)\ No newline at end of file