Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.
Python agentagentic-aiagentic-frameworkagentic-workflowaiautomationclaudedeepseekgenaigptllmlow-codemcpnextjsno-codeopenaipythonskillsworkflow
fix: replace str(e) with generic messages in error responses (#43049)
Juhyuk choid2fe62a9fd7d
diff --git a/api/controllers/console/datasets/external.py b/api/controllers/console/datasets/external.pyindex 3f86a1c61f7..4324ad16597 100644--- a/api/controllers/console/datasets/external.py+++ b/api/controllers/console/datasets/external.py@@ -1,5 +1,6 @@from __future__ import annotations+import loggingfrom datetime import datetimefrom typing import Any, Neverfrom uuid import UUID@@ -36,6 +37,7 @@ from services.errors.dataset import DatasetNameDuplicateError as DatasetNameDuplfrom services.knowledge.dataset_access import DatasetAccessDeniedError, DatasetNotFoundErrorfrom services.knowledge.external.application import ExternalHitTestingError, ExternalTemplateNotFoundError+logger = logging.getLogger(__name__)_DATASET_EDIT_ROLES = frozenset({TenantAccountRole.OWNER, TenantAccountRole.ADMIN, TenantAccountRole.EDITOR, TenantAccountRole.DATASET_OPERATOR})@@ -50,7 +52,8 @@ def _raise_external_error(error: Exception) -> Never:if isinstance(error, DatasetNameDuplicateFailure):raise DatasetNameDuplicateError() from errorif isinstance(error, ExternalHitTestingError):- raise InternalServerError(str(error)) from error+ logger.exception("External hit testing failed")+ raise InternalServerError() from errorraise errordiff --git a/api/controllers/console/datasets/hit_testing_base.py b/api/controllers/console/datasets/hit_testing_base.pyindex a1a59cbd401..893d0d7b08f 100644--- a/api/controllers/console/datasets/hit_testing_base.py+++ b/api/controllers/console/datasets/hit_testing_base.py@@ -157,6 +157,6 @@ class DatasetsHitTestingBase:raise CompletionRequestError(e.description)except ValueError as e:raise ValueError(str(e))- except Exception as e:+ except Exception:logger.exception("Hit testing failed.")- raise InternalServerError(str(e))+ raise InternalServerError()diff --git a/api/tests/unit_tests/controllers/console/datasets/test_hit_testing_base.py b/api/tests/unit_tests/controllers/console/datasets/test_hit_testing_base.pyindex 68a0944ada7..b3d9a6a1ec4 100644--- a/api/tests/unit_tests/controllers/console/datasets/test_hit_testing_base.py+++ b/api/tests/unit_tests/controllers/console/datasets/test_hit_testing_base.py@@ -291,5 +291,6 @@ class TestPerformHitTesting:"retrieve",side_effect=Exception("boom"),):- with pytest.raises(InternalServerError, match="boom"):+ with pytest.raises(InternalServerError) as exc_info:DatasetsHitTestingBase.perform_hit_testing(Mock(), dataset, {"query": "hello"}, account, "tenant-1")+ assert "boom" not in str(exc_info.value)