Skip to content

fix: replace 14 bare excepts with except Exception#2546

Merged
WMC001 merged 1 commit into
ModelEngine-Group:mainfrom
haosenwang1018:fix/bare-excepts
Mar 12, 2026
Merged

fix: replace 14 bare excepts with except Exception#2546
WMC001 merged 1 commit into
ModelEngine-Group:mainfrom
haosenwang1018:fix/bare-excepts

Conversation

@haosenwang1018

Copy link
Copy Markdown
Contributor

Replace 14 bare except: with except Exception: across 5 files. Bare except: catches KeyboardInterrupt and SystemExit, masking real errors.

Bare except catches KeyboardInterrupt and SystemExit, masking real errors.
@WMC001 WMC001 merged commit 31a1752 into ModelEngine-Group:main Mar 12, 2026
2 checks passed
@@ -399,7 +399,7 @@ def __call__(self, task: str, **kwargs):
try:

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

except: 替换为 except Exception: 是一个好的改进,但某些地方(如 core_agent.py:399)捕获所有异常后只记录空字符串,可能会掩盖重要错误信息。建议记录实际的异常信息,如 self.observer.add_message(self.name, ProcessType.AGENT_FINISH, str(e))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants