Consolidate McpClientException/McpServerException into McpException (#209)

This commit is contained in:
Stephen Toub 2025-04-03 21:10:57 -04:00 • committed by GitHub
commit 8fcdf95785
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 163 additions and 197 deletions

View file

@ -217,7 +217,7 @@ public class McpServerBuilderExtensionsPromptsTests : LoggedTest, IAsyncDisposab
{
IMcpClient client = await CreateMcpClientForServer();
await Assert.ThrowsAsync<McpClientException>(async () => await client.GetPromptAsync(
await Assert.ThrowsAsync<McpException>(async () => await client.GetPromptAsync(
nameof(SimplePrompts.ThrowsException),
cancellationToken: TestContext.Current.CancellationToken));
}
@ -227,7 +227,7 @@ public class McpServerBuilderExtensionsPromptsTests : LoggedTest, IAsyncDisposab
{
IMcpClient client = await CreateMcpClientForServer();
var e = await Assert.ThrowsAsync<McpClientException>(async () => await client.GetPromptAsync(
var e = await Assert.ThrowsAsync<McpException>(async () => await client.GetPromptAsync(
"NotRegisteredPrompt",
cancellationToken: TestContext.Current.CancellationToken));
@ -239,7 +239,7 @@ public class McpServerBuilderExtensionsPromptsTests : LoggedTest, IAsyncDisposab
{
IMcpClient client = await CreateMcpClientForServer();
var e = await Assert.ThrowsAsync<McpClientException>(async () => await client.GetPromptAsync(
var e = await Assert.ThrowsAsync<McpException>(async () => await client.GetPromptAsync(
nameof(SimplePrompts.ReturnsChatMessages),
cancellationToken: TestContext.Current.CancellationToken));

View file

@ -435,7 +435,7 @@ public class McpServerBuilderExtensionsToolsTests : LoggedTest, IAsyncDisposable
{
IMcpClient client = await CreateMcpClientForServer();
var e = await Assert.ThrowsAsync<McpClientException>(async () => await client.CallToolAsync(
var e = await Assert.ThrowsAsync<McpException>(async () => await client.CallToolAsync(
"NotRegisteredTool",
cancellationToken: TestContext.Current.CancellationToken));