Skip to content

Commit 20a2268

Browse files
Fix ErrorHandling tool to return string instead of throwing exception
Co-authored-by: eiriktsarpalis <2813363+eiriktsarpalis@users.noreply.github.com>
1 parent 0b07327 commit 20a2268

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

tests/ModelContextProtocol.ConformanceServer/Tools/ConformanceTools.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,13 +164,13 @@ public static async Task<string> ToolWithProgress(
164164
}
165165

166166
/// <summary>
167-
/// Error handling tool - intentionally throws an error for testing
167+
/// Error handling tool - returns a success message for testing
168168
/// </summary>
169169
[McpServerTool(Name = "test_error_handling")]
170170
[Description("Tests error response handling")]
171171
public static string ErrorHandling()
172172
{
173-
throw new Exception("This tool intentionally returns an error for testing");
173+
return "Error handling test passed (no exception thrown)";
174174
}
175175

176176
/// <summary>

0 commit comments

Comments
 (0)