Add ResourceNotFound error code (-32002) (#1062)
This commit is contained in:
parent
4808ca0324
commit
d76bc16bd1
1 changed files with 36 additions and 26 deletions
|
|
@ -108,7 +108,7 @@ public partial class McpServerBuilderExtensionsResourcesTests : ClientServerTest
|
|||
};
|
||||
}
|
||||
|
||||
throw new McpProtocolException($"Resource not found: {request.Params?.Uri}");
|
||||
throw new McpProtocolException($"Resource not found: {request.Params?.Uri}", McpErrorCode.ResourceNotFound);
|
||||
})
|
||||
.WithResources<SimpleResources>();
|
||||
}
|
||||
|
|
@ -249,6 +249,7 @@ public partial class McpServerBuilderExtensionsResourcesTests : ClientServerTest
|
|||
cancellationToken: TestContext.Current.CancellationToken));
|
||||
|
||||
Assert.Contains("Resource not found", e.Message);
|
||||
Assert.Equal(McpErrorCode.ResourceNotFound, e.ErrorCode);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
|
|
|
|||
Loading…
Reference in a new issue