Skip to content

Include 'timed out' message in async timeout exceptions - #1161

Open
Kludex wants to merge 1 commit into
mainfrom
timeout-message
Open

Include 'timed out' message in async timeout exceptions#1161
Kludex wants to merge 1 commit into
mainfrom
timeout-message

Conversation

@Kludex

@Kludex Kludex commented Aug 25, 2026

Copy link
Copy Markdown
Member

Closes #742.

The sync backend raises timeout exceptions carrying socket.timeout's "timed out" message, but the async backends wrap anyio's bare TimeoutError (and trio's TooSlowError), which have empty messages - so httpx2.ReadTimeout printed nothing in async tracebacks and logs.

map_exceptions now supplies "timed out" when mapping an exception with an empty message to a TimeoutException subclass, making sync and async consistent.

AI Disclaimer

This PR was developed with the assistance of either Claude or Codex. I've reviewed and verified the changes.

Review in cubic

@Kludex
Kludex deployed to cloudflare August 25, 2026 12:52 — with GitHub Actions Active
@github-actions

Copy link
Copy Markdown

@codspeed-hq

codspeed-hq Bot commented Aug 25, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 17 untouched benchmarks
⏩ 7 skipped benchmarks1


Comparing timeout-message (44f44d8) with main (0c5012e)

Open in CodSpeed

Footnotes

  1. 7 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

No issues found across 2 files

Re-trigger cubic

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.

ReadTimeout in asyncio has no message

1 participant