mirror of
https://github.com/aljazceru/mcp-python-sdk.git
synced 2025-12-19 14:54:24 +01:00
fix: Add constructor for McpError to allow setting field
Backport of #116 by @allenporter to v1.1.x branch. Fixes an issue where exception handling code fails with AttributeError when accessing the error field of McpError.
This commit is contained in:
committed by
David Soria Parra
parent
312e9da2dc
commit
b89cabc7df
@@ -7,3 +7,8 @@ class McpError(Exception):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
error: ErrorData
|
error: ErrorData
|
||||||
|
|
||||||
|
def __init__(self, error: ErrorData):
|
||||||
|
"""Initialize McpError."""
|
||||||
|
super().__init__(error.message)
|
||||||
|
self.error = error
|
||||||
|
|||||||
Reference in New Issue
Block a user