File tree Expand file tree Collapse file tree 2 files changed +5
-3
lines changed
Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -30,12 +30,12 @@ dependencies = [
3030 " sse-starlette>=1.6.1" ,
3131 " pydantic-settings>=2.5.2" ,
3232 " uvicorn>=0.23.1" ,
33- " websockets>=15.0.1" ,
3433]
3534
3635[project .optional-dependencies ]
3736rich = [" rich>=13.9.4" ]
3837cli = [" typer>=0.12.4" , " python-dotenv>=1.0.0" ]
38+ ws = [" websockets>=15.0.1" ]
3939
4040[project .scripts ]
4141mcp = " mcp.cli:app [cli]"
Original file line number Diff line number Diff line change @@ -56,8 +56,9 @@ async def ws_reader():
5656 except ValidationError as exc :
5757 # If JSON parse or model validation fails, send the exception
5858 await read_stream_writer .send (exc )
59- except (anyio .ClosedResourceError , Exception ):
59+ except (anyio .ClosedResourceError , Exception ) as e :
6060 await ws .close ()
61+ raise e
6162
6263 async def ws_writer ():
6364 """
@@ -71,8 +72,9 @@ async def ws_writer():
7172 by_alias = True , mode = "json" , exclude_none = True
7273 )
7374 await ws .send (json .dumps (msg_dict ))
74- except (anyio .ClosedResourceError , Exception ):
75+ except (anyio .ClosedResourceError , Exception ) as e :
7576 await ws .close ()
77+ raise e
7678
7779 async with anyio .create_task_group () as tg :
7880 # Start reader and writer tasks
You can’t perform that action at this time.
0 commit comments