File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change 88import anyio
99import httpx
1010from anyio .streams .memory import MemoryObjectReceiveStream , MemoryObjectSendStream
11- from pydantic import BaseModel
11+ from pydantic import BaseModel , ValidationError
1212from typing_extensions import Self
1313
1414from mcp .shared .exceptions import McpError
@@ -357,7 +357,7 @@ async def _receive_loop(self) -> None:
357357 by_alias = True , mode = "json" , exclude_none = True
358358 )
359359 )
360- except Exception as e :
360+ except ValidationError as e :
361361 # For other validation errors, log and continue
362362 logging .warning (
363363 "Failed to validate request: %s. Message was: %s" ,
@@ -389,7 +389,7 @@ async def _receive_loop(self) -> None:
389389 by_alias = True , mode = "json" , exclude_none = True
390390 )
391391 )
392- except Exception as e :
392+ except ValidationError as e :
393393 # For other validation errors, log and continue
394394 logging .warning (
395395 "Failed to validate notification: %s. Message was: %s" ,
You can’t perform that action at this time.
0 commit comments