From 2703d3dbfe6063b3135087e7037643e094a7cd3a Mon Sep 17 00:00:00 2001 From: Abhishek Yadav Date: Sun, 22 Mar 2026 01:54:51 +0530 Subject: [PATCH] fix: update error handling to check for NEO4J_PASSWORD instead of ZEP_API_KEY in simulation API - Changed error messages to reflect the new configuration requirement for Neo4j. - Ensured consistent handling of missing credentials across multiple functions. --- backend/app/api/simulation.py | 12 ++++++------ frontend/package-lock.json | 4 ---- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/backend/app/api/simulation.py b/backend/app/api/simulation.py index 3a0f6816..77acc1a9 100644 --- a/backend/app/api/simulation.py +++ b/backend/app/api/simulation.py @@ -56,10 +56,10 @@ def get_graph_entities(graph_id: str): enrich: 是否获取相关边信息(默认true) """ try: - if not Config.ZEP_API_KEY: + if not Config.NEO4J_PASSWORD: return jsonify({ "success": False, - "error": "ZEP_API_KEY未配置" + "error": "NEO4J未配置" }), 500 entity_types_str = request.args.get('entity_types', '') @@ -93,10 +93,10 @@ def get_graph_entities(graph_id: str): def get_entity_detail(graph_id: str, entity_uuid: str): """获取单个实体的详细信息""" try: - if not Config.ZEP_API_KEY: + if not Config.NEO4J_PASSWORD: return jsonify({ "success": False, - "error": "ZEP_API_KEY未配置" + "error": "NEO4J未配置" }), 500 reader = ZepEntityReader() @@ -126,10 +126,10 @@ def get_entity_detail(graph_id: str, entity_uuid: str): def get_entities_by_type(graph_id: str, entity_type: str): """获取指定类型的所有实体""" try: - if not Config.ZEP_API_KEY: + if not Config.NEO4J_PASSWORD: return jsonify({ "success": False, - "error": "ZEP_API_KEY未配置" + "error": "NEO4J未配置" }), 500 enrich = request.args.get('enrich', 'true').lower() == 'true' diff --git a/frontend/package-lock.json b/frontend/package-lock.json index 8c4fa710..fee02cad 100644 --- a/frontend/package-lock.json +++ b/frontend/package-lock.json @@ -1331,7 +1331,6 @@ "resolved": "https://registry.npmjs.org/d3-selection/-/d3-selection-3.0.0.tgz", "integrity": "sha512-fmTRWbNMmsmWq6xJV8D19U/gw/bwrHfNXxrIN+HfZgnzqTHp9jOmKMhsTUjXOJnZOdZY9Q28y4yebKzqDKlxlQ==", "license": "ISC", - "peer": true, "engines": { "node": ">=12" } @@ -1809,7 +1808,6 @@ "integrity": "sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q==", "dev": true, "license": "MIT", - "peer": true, "engines": { "node": ">=12" }, @@ -1943,7 +1941,6 @@ "integrity": "sha512-ITcnkFeR3+fI8P1wMgItjGrR10170d8auB4EpMLPqmx6uxElH3a/hHGQabSHKdqd4FXWO1nFIp9rRn7JQ34ACQ==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "esbuild": "^0.25.0", "fdir": "^6.5.0", @@ -2018,7 +2015,6 @@ "resolved": "https://registry.npmjs.org/vue/-/vue-3.5.25.tgz", "integrity": "sha512-YLVdgv2K13WJ6n+kD5owehKtEXwdwXuj2TTyJMsO7pSeKw2bfRNZGjhB7YzrpbMYj5b5QsUebHpOqR3R3ziy/g==", "license": "MIT", - "peer": true, "dependencies": { "@vue/compiler-dom": "3.5.25", "@vue/compiler-sfc": "3.5.25",