Skip to content

Commit 8c703a5

Browse files
author
Jay Hemnani
committed
fix: use CONNECTION_CLOSED constant instead of magic number
1 parent de83182 commit 8c703a5

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/mcp/client/streamable_http.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
)
2929
from mcp.shared.message import ClientMessageMetadata, SessionMessage
3030
from mcp.types import (
31+
CONNECTION_CLOSED,
3132
ErrorData,
3233
InitializeResult,
3334
JSONRPCError,
@@ -443,7 +444,7 @@ async def _handle_sse_response(
443444
jsonrpc="2.0",
444445
id=request_id,
445446
error=ErrorData(
446-
code=-32000,
447+
code=CONNECTION_CLOSED,
447448
message="SSE stream disconnected before receiving response",
448449
),
449450
)

0 commit comments

Comments
 (0)