`v2`: Errors refactor (ProtocolError, SdkError, OAuthError) by KKonstantinov · Pull Request #1454 · modelcontextprotocol/typescript-sdk

@KKonstantinov

@KKonstantinov

@KKonstantinov KKonstantinov changed the title v2: Errors refactor (ProtocolError, SdkError) v2: Errors refactor (ProtocolError, SdkError, OAuthError)

Feb 3, 2026

@KKonstantinov

mattzcarey

felixweinberger added a commit that referenced this pull request

Mar 25, 2026
Follow-up to #1454. Converts the 6 capability-assertion call sites that
were missed to throw SdkError(SdkErrorCode.CapabilityNotSupported, ...)
instead of plain Error:

- Client.assertCapability() in packages/client/src/client/client.ts
- assertToolsCallTaskCapability() in experimental/tasks/helpers.ts (2 throws)
- assertClientRequestTaskCapability() in experimental/tasks/helpers.ts (3 throws)

Fixes #430
Closes #1329

Co-authored-by: Matteo Gobbo <info@matteogobbo.it>

This was referenced

Mar 26, 2026

This was referenced

Mar 30, 2026