fix: auto-fix code issues (cron)

- 修复缺失导入: main.py 添加 AttributeTemplate 和 EntityAttribute 导入
- 修复裸异常捕获: 将 BaseException 改为具体异常类型
  - neo4j_manager.py: Exception
  - main.py: json.JSONDecodeError, ValueError, Exception
  - export_manager.py: AttributeError, TypeError, ValueError
  - localization_manager.py: ValueError, AttributeError
  - performance_manager.py: TypeError, ValueError
  - plugin_manager.py: OSError, IOError
- 修复部分行长度问题: security_manager.py 长行拆分
This commit is contained in:
OpenClaw Bot
2026-02-28 21:14:59 +08:00
parent 741a4b666c
commit 8492e7a0d3
7 changed files with 21 additions and 12 deletions

View File

@@ -59,7 +59,13 @@ except ImportError:
TINGWU_AVAILABLE = False
try:
from db_manager import Entity, EntityMention, get_db_manager
from db_manager import (
AttributeTemplate,
Entity,
EntityAttribute,
EntityMention,
get_db_manager,
)
DB_AVAILABLE = True
except ImportError as e:
@@ -2016,7 +2022,7 @@ async def agent_suggest(project_id: str, _=Depends(verify_api_key)):
try:
data = json.loads(json_match.group())
return data
except BaseException:
except (json.JSONDecodeError, ValueError):
pass
return {"suggestions": []}
@@ -3060,7 +3066,7 @@ async def export_report_pdf_endpoint(project_id: str, _=Depends(verify_api_key))
reasoner = get_knowledge_reasoner()
summary_result = reasoner.generate_project_summary(project_id, db)
summary = summary_result.get("summary", "")
except BaseException:
except Exception:
pass
export_mgr = get_export_manager()