Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions src/mcp/client/sse.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ async def sse_client(
client,
"GET",
url,
timeout=httpx.Timeout(timeout, read=sse_read_timeout),
Copy link
Member

@Kludex Kludex Jun 13, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That is being passed on line 57... 👀

) as event_source:
event_source.response.raise_for_status()
logger.debug("SSE connection established")
Expand Down Expand Up @@ -106,7 +107,7 @@ async def sse_reader(
case _:
logger.warning(f"Unknown SSE event: {sse.event}")
except Exception as exc:
logger.error(f"Error in sse_reader: {exc}")
logger.error(f"Error in sse_reader: {exc.__class__.__name__}", exc_info=True)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
logger.error(f"Error in sse_reader: {exc.__class__.__name__}", exc_info=True)
logger.exception("Error in sse_reader")

await read_stream_writer.send(exc)
finally:
await read_stream_writer.aclose()
Expand All @@ -127,7 +128,8 @@ async def post_writer(endpoint_url: str):
response.raise_for_status()
logger.debug("Client message sent successfully: " f"{response.status_code}")
except Exception as exc:
logger.error(f"Error in post_writer: {exc}")
logger.error(f"Error in post_writer: {exc.__class__.__name__}", exc_info=True)
await read_stream_writer.send(exc)
finally:
await write_stream.aclose()

Expand Down
Loading