Skip to content

Commit 03393fc

Browse files
authored
Merge branch 'main' into add-tests-resource-error
2 parents 3c58265 + acba547 commit 03393fc

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

docs/migration.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ from mcp.shared.exceptions import McpError
133133
try:
134134
result = await session.call_tool("my_tool")
135135
except McpError as e:
136-
print(f"Error: {e.message}")
136+
print(f"Error: {e.error.message}")
137137
```
138138

139139
**After (v2):**

src/mcp/server/experimental/request_context.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ def validate_task_mode(
9191
error = ErrorData(code=METHOD_NOT_FOUND, message="This tool does not support task-augmented invocation")
9292

9393
if error is not None and raise_error:
94-
raise MCPError(code=METHOD_NOT_FOUND, message=error.message)
94+
raise MCPError.from_error_data(error)
9595

9696
return error
9797

0 commit comments

Comments
 (0)