Clean up (use of) McpException and McpTransportException (#321)
* Clean up (use of) McpException * Replace McpTransportException with InvalidOperationException * Add cancellation test
This commit is contained in:
parent
d65ddce268
commit
7d77be68cf
1 changed files with 231 additions and 219 deletions
|
|
@ -108,7 +108,7 @@ public class DiagnosticTests
|
|||
a.Kind == ActivityKind.Client);
|
||||
|
||||
Assert.Equal(ActivityStatusCode.Error, doesNotExistToolClient.Status);
|
||||
Assert.Equal("-32603", doesNotExistToolClient.Tags.Single(t => t.Key == "rpc.jsonrpc.error_code").Value);
|
||||
Assert.Equal("-32602", doesNotExistToolClient.Tags.Single(t => t.Key == "rpc.jsonrpc.error_code").Value);
|
||||
|
||||
var doesNotExistToolServer = Assert.Single(activities, a =>
|
||||
a.Tags.Any(t => t.Key == "mcp.tool.name" && t.Value == "does-not-exist") &&
|
||||
|
|
@ -117,7 +117,7 @@ public class DiagnosticTests
|
|||
a.Kind == ActivityKind.Server);
|
||||
|
||||
Assert.Equal(ActivityStatusCode.Error, doesNotExistToolServer.Status);
|
||||
Assert.Equal("-32603", doesNotExistToolClient.Tags.Single(t => t.Key == "rpc.jsonrpc.error_code").Value);
|
||||
Assert.Equal("-32602", doesNotExistToolClient.Tags.Single(t => t.Key == "rpc.jsonrpc.error_code").Value);
|
||||
}
|
||||
|
||||
private static async Task RunConnected(Func<IMcpClient, IMcpServer, Task> action)
|
||||
|
|
|
|||
Loading…
Reference in a new issue