You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: preserve HTTP status codes in streamable HTTP transport error responses
The streamable HTTP transport had two error propagation issues:
1. Non-2xx responses used generic error messages ('Session terminated',
'Server returned an error response') that discarded the HTTP status
code, making it impossible to distinguish auth errors (401/403) from
server errors (500) or not-found (404).
2. Connection/transport errors (timeouts, DNS failures, connection
refused) raised inside _handle_post_request were not caught, causing
callers to hang indefinitely waiting for a response on the read
stream.
Fix:
- Consolidate 404 and general >= 400 handlers into a single block that
reads the response body and includes 'HTTP {status}: {body}' in the
error message
- Wrap _handle_post_request in try/except to catch transport errors and
forward them as JSONRPCError through the read stream before re-raising
Fixes#2110
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
0 commit comments