Skip to content

fix(tmwebdriver): preserve exception chain in _remote_cmd ConnectionError#663

Open
Kailigithub wants to merge 1 commit into
lsdefine:mainfrom
Kailigithub:optimize/tmwebdriver-b904-from-chain
Open

fix(tmwebdriver): preserve exception chain in _remote_cmd ConnectionError#663
Kailigithub wants to merge 1 commit into
lsdefine:mainfrom
Kailigithub:optimize/tmwebdriver-b904-from-chain

Conversation

@Kailigithub

Copy link
Copy Markdown
Contributor

Summary

The _remote_cmd method in TMWebDriver catches connection errors and re-raises with a user-friendly message, but discards the original exception. Adding as e + from e preserves the causal chain in the traceback, making it easier to diagnose whether the failure was a DNS issue, a refused connection, or a timeout.

Changes

  • TMWebDriver.py:246-247 — capture the original exception (as e) and chain it (from e)

Two-line change. The user-facing error message is unchanged; only the traceback depth improves.

Verification

  • py_compile TMWebDriver.py — passes
  • ruff check TMWebDriver.py --select=B904 — passes (was the only B904 in the file)

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.

1 participant