fix: add UnsupportedCapabilityError to handle capabilities custom exception#1329
fix: add UnsupportedCapabilityError to handle capabilities custom exception#1329gotamm wants to merge 8 commits intomodelcontextprotocol:mainfrom
Conversation
|
@modelcontextprotocol/client
@modelcontextprotocol/server
@modelcontextprotocol/express
@modelcontextprotocol/hono
@modelcontextprotocol/node
commit: |
|
Hi @KKonstantinov, I think this PR is no longer needed and should be closed due to #1454. |
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>
|
Thanks @gotamm for following up - opened #1761 to finish the |
Replace generic
ErrorwithUnsupportedCapabilityErrorwhen capabilities are not supported, allowing applications to distinguish capability errors from actual failures.Motivation and Context
It fixes the issue #430
How Has This Been Tested?
Breaking Changes
There are no breaking changes.
Types of changes
Checklist
Additional context
Added
UnsupportedCapabilityErrorclass inpackages/core/src/types/types.ts.I assigned to it an error code of -32043 following what's been done before, but it should be checked if it's correct.