Add ResourceNotFound error code (-32002) (#1062)

This commit is contained in:
Copilot 2025-12-05 10:39:30 -08:00 • committed by GitHub
commit d76bc16bd1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -273,7 +273,7 @@ internal sealed partial class McpServerImpl : McpServer
listResourcesHandler ??= (static async (_, __) => new ListResourcesResult());
listResourceTemplatesHandler ??= (static async (_, __) => new ListResourceTemplatesResult());
readResourceHandler ??= (static async (request, _) => throw new McpProtocolException($"Unknown resource URI: '{request.Params?.Uri}'", McpErrorCode.InvalidParams));
readResourceHandler ??= (static async (request, _) => throw new McpProtocolException($"Unknown resource URI: '{request.Params?.Uri}'", McpErrorCode.ResourceNotFound));
subscribeHandler ??= (static async (_, __) => new EmptyResult());
unsubscribeHandler ??= (static async (_, __) => new EmptyResult());
var listChanged = resourcesCapability?.ListChanged;