Skip to content

mcp: preserve transport errors in Write error chain#888

Open
jpugliesi wants to merge 2 commits intomodelcontextprotocol:mainfrom
jpugliesi:jpugliesi/wrap-round-tripper-error
Open

mcp: preserve transport errors in Write error chain#888
jpugliesi wants to merge 2 commits intomodelcontextprotocol:mainfrom
jpugliesi:jpugliesi/wrap-round-tripper-error

Conversation

@jpugliesi
Copy link
Copy Markdown

@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

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