Skip to content

fix: preserve exception chain in wait_dispatched timeout#222

Open
XinyuanWarms wants to merge 1 commit into
andrewyng:mainfrom
XinyuanWarms:fix/wait-dispatched-exception-chain
Open

fix: preserve exception chain in wait_dispatched timeout#222
XinyuanWarms wants to merge 1 commit into
andrewyng:mainfrom
XinyuanWarms:fix/wait-dispatched-exception-chain

Conversation

@XinyuanWarms

Copy link
Copy Markdown

Summary

  • RelayHub.wait_dispatched re-raised a fresh TimeoutError without chaining it to the caught asyncio.TimeoutError, so the original exception and its context were lost.
  • Add as exc and raise ... from exc so __cause__ is preserved, making flaky relay timeouts easier to debug.

Fixes #167

Test plan

  • pytest tests/test_slack_relay.py — no new failures vs. baseline (the 4
    pre-existing timeouts are network/environment-related and unchanged by this fix)
  • Verified the raised TimeoutError.__cause__ is now the original
    asyncio.TimeoutError (it was None before)
    Before:
Snipaste_2026-07-27_11-04-58 After: Snipaste_2026-07-27_11-05-15

Chain the original asyncio.TimeoutError via 'raise ... from exc' so
__cause__ is retained, making flaky relay timeouts easier to debug.

Fixes andrewyng#167
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.

wait_dispatched swallows the original TimeoutError on timeout

1 participant