refactor: downgrade unhandled notification logging from error to warn · forwaytech/java-sdk@110a8d1 · GitHub
Skip to content

Commit 110a8d1

Browse files
committed
refactor: downgrade unhandled notification logging from error to warn
- Change logger.error() to logger.warn() for unhandled notification methods - Log full notification object instead of just method name for better context - Affects McpClientSession, McpServerSession, and McpStreamableServerSession Signed-off-by: Christian Tzolov <christian.tzolov@broadcom.com>
1 parent 7f37ddc commit 110a8d1

3 files changed

Lines changed: 3 additions & 3 deletions

File tree

mcp/src/main/java/io/modelcontextprotocol/spec/McpClientSession.java

Lines changed: 1 addition & 1 deletion

mcp/src/main/java/io/modelcontextprotocol/spec/McpServerSession.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ private Mono<Void> handleIncomingNotification(McpSchema.JSONRPCNotification noti
294294

295295
var handler = notificationHandlers.get(notification.method());
296296
if (handler == null) {
297-
logger.error("No handler registered for notification method: {}", notification.method());
297+
logger.warn("No handler registered for notification method: {}", notification);
298298
return Mono.empty();
299299
}
300300
return this.exchangeSink.asMono().flatMap(exchange -> handler.handle(exchange, notification.params()));

mcp/src/main/java/io/modelcontextprotocol/spec/McpStreamableServerSession.java

Lines changed: 1 addition & 1 deletion

0 commit comments

Comments
 (0)