Skip to content

mcp: preserve transport errors in Write error chain#888

Merged
maciej-kisiel merged 3 commits intomodelcontextprotocol:mainfrom
jpugliesi:jpugliesi/wrap-round-tripper-error
Apr 24, 2026
Merged

mcp: preserve transport errors in Write error chain#888
maciej-kisiel merged 3 commits intomodelcontextprotocol:mainfrom
jpugliesi:jpugliesi/wrap-round-tripper-error

Conversation

@jpugliesi
Copy link
Copy Markdown
Contributor

@jpugliesi jpugliesi commented Apr 9, 2026

mcp: preserve transport errors in Write error chain

Custom RoundTrippers that return typed errors (e.g. for auth failures) have those errors flattened to strings by %v, making errors.As unusable for callers inspecting transport-level errors.

This is inconsistent with the OAuth handler path (line 1807) which already uses %w to preserve errors for client inspection.

Relates to #579

@maciej-kisiel maciej-kisiel merged commit 5f2cd8f into modelcontextprotocol:main Apr 24, 2026
9 checks passed
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