mirror of
https://github.com/PrefectHQ/fastmcp.git
synced 2026-08-23 05:54:19 +02:00
Trap timeouterror
This commit is contained in:
parent
ec76d180bc
commit
f084f3e3db
1 changed files with 1 additions and 2 deletions
|
|
@ -1,4 +1,3 @@
|
|||
import asyncio
|
||||
import datetime
|
||||
from contextlib import AsyncExitStack, asynccontextmanager
|
||||
from pathlib import Path
|
||||
|
|
@ -164,7 +163,7 @@ class Client:
|
|||
with anyio.fail_after(1):
|
||||
self._initialize_result = await self._session.initialize()
|
||||
yield
|
||||
except asyncio.TimeoutError:
|
||||
except TimeoutError:
|
||||
raise RuntimeError("Failed to initialize server session")
|
||||
finally:
|
||||
self._exit_stack = None
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue