Skip to content

fix: replace bare except and generic raise Exception in base_tool_node.py - #7896

Closed
Cmz9111 wants to merge 1 commit into
1Panel-dev:v2from
Cmz9111:fix-code-quality-apps_application_flow_step_nod-3
Closed

Cmz9111 wants to merge 1 commit into
1Panel-dev:v2from
Cmz9111:fix-code-quality-apps_application_flow_step_nod-3

Conversation

@Cmz9111

@Cmz9111 Cmz9111 commented Nov 13, 2026

Copy link
Copy Markdown

Problem

This PR fixes code quality issues in apps/application/flow/step_node/tool_node/impl/base_tool_node.py:

  • Found 3 generic raise Exception(...) that should use specific exception types

Changes

  • Replaced bare except: clauses with except Exception: to avoid catching SystemExit, KeyboardInterrupt, and GeneratorExit
  • Replaced generic raise Exception(...) with raise RuntimeError(...) for better error handling specificity

Rationale

  • Bare except: catches all exceptions including SystemExit and KeyboardInterrupt, preventing clean shutdowns
  • Generic raise Exception(...) forces callers to catch the overly broad Exception instead of specific error types

Testing

The changes preserve existing exception handling semantics while improving type safety and debuggability.

@liuruibin liuruibin closed this Nov 13, 2026
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.

2 participants