fix(server): call onerror callback for all transport errors by codewithkenzo · Pull Request #1433 · modelcontextprotocol/typescript-sdk
This was referenced
Feb 2, 2026Adds missing onerror callback invocations before every createJsonErrorResponse call in WebStandardStreamableHTTPServerTransport. This ensures that transport errors are no longer silently swallowed and can be observed via the onerror callback. Changes: - Add this.onerror?.() calls to 15 locations in streamableHttp.ts - Add 10 test cases to verify onerror is called for various error conditions Fixes modelcontextprotocol#1395
… errors - Add onerror for writeSSEEvent catch (surfaces actual write failure) - Add onerror for handleUnsupportedRequest (405 method not allowed) - Surface the caught SyntaxError/ZodError in JSON and JSON-RPC parse catches instead of constructing a generic 'Parse error' string — more useful for debugging - Update tests to assert on error types (SyntaxError, ZodError)
This was referenced
Mar 12, 2026This was referenced
Mar 25, 2026…r messages - Remove redundant onerror call in replayEvents send callback (writeSSEEvent already reports the actual error) - Add trailing period to handleUnsupportedRequest onerror message to match response body - Include supported versions list in validateProtocolVersion onerror message to match response body
This was referenced
Mar 25, 2026This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters