Skip to content

Commit b25dbcc

Browse files
checkpoint before error propagation
1 parent e889f49 commit b25dbcc

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/mcp/client/session.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,11 @@ async def __call__(
5757
async def _default_message_handler(
5858
message: RequestResponder[types.ServerRequest, types.ClientResult] | types.ServerNotification | Exception,
5959
) -> None:
60+
await anyio.lowlevel.checkpoint()
61+
6062
if isinstance(message, Exception):
6163
# Re-raise exceptions so they propagate back to the application
6264
raise message
63-
await anyio.lowlevel.checkpoint()
6465

6566

6667
async def _default_sampling_callback(

0 commit comments

Comments
 (0)