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:
parent
312e9da2dc
commit
b89cabc7df
1 changed files with 5 additions and 0 deletions
|
|
@ -7,3 +7,8 @@ class McpError(Exception):
|
|||
"""
|
||||
|
||||
error: ErrorData
|
||||
|
||||
def __init__(self, error: ErrorData):
|
||||
"""Initialize McpError."""
|
||||
super().__init__(error.message)
|
||||
self.error = error
|
||||
|
|
|
|||
Loading…
Reference in a new issue