We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e80c015 commit 5f80585Copy full SHA for 5f80585
src/mcp/server/lowlevel/server.py
@@ -536,6 +536,19 @@ async def _handle_message(
536
)
537
case types.ClientNotification(root=notify):
538
await self._handle_notification(notify)
539
+ case Exception():
540
+ logger.error(f"Received error message: {message}")
541
+ if raise_exceptions:
542
+ raise message
543
+ # Send the error as a notification since we don't have a request context
544
+ await session.send_log_message(
545
+ level="error",
546
+ data=types.ErrorData(
547
+ code=types.INTERNAL_ERROR,
548
+ message=str(message),
549
+ data=None
550
+ )
551
552
553
for warning in w:
554
logger.info(f"Warning: {warning.category.__name__}: {warning.message}")
0 commit comments