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>
This commit is contained in:
parent
7f37ddc4d7
commit
110a8d1940
3 changed files with 3 additions and 3 deletions
|
|
@ -221,7 +221,7 @@ public class McpClientSession implements McpSession {
|
|||
return Mono.defer(() -> {
|
||||
var handler = notificationHandlers.get(notification.method());
|
||||
if (handler == null) {
|
||||
logger.error("No handler registered for notification method: {}", notification.method());
|
||||
logger.warn("No handler registered for notification method: {}", notification);
|
||||
return Mono.empty();
|
||||
}
|
||||
return handler.handle(notification.params());
|
||||
|
|
|
|||
|
|
@ -294,7 +294,7 @@ public class McpServerSession implements McpLoggableSession {
|
|||
|
||||
var handler = notificationHandlers.get(notification.method());
|
||||
if (handler == null) {
|
||||
logger.error("No handler registered for notification method: {}", notification.method());
|
||||
logger.warn("No handler registered for notification method: {}", notification);
|
||||
return Mono.empty();
|
||||
}
|
||||
return this.exchangeSink.asMono().flatMap(exchange -> handler.handle(exchange, notification.params()));
|
||||
|
|
|
|||
|
|
@ -197,7 +197,7 @@ public class McpStreamableServerSession implements McpLoggableSession {
|
|||
McpTransportContext transportContext = ctx.getOrDefault(McpTransportContext.KEY, McpTransportContext.EMPTY);
|
||||
McpNotificationHandler notificationHandler = this.notificationHandlers.get(notification.method());
|
||||
if (notificationHandler == null) {
|
||||
logger.error("No handler registered for notification method: {}", notification.method());
|
||||
logger.warn("No handler registered for notification method: {}", notification);
|
||||
return Mono.empty();
|
||||
}
|
||||
McpLoggableSession listeningStream = this.listeningStreamRef.get();
|
||||
|
|
|
|||
Loading…
Reference in a new issue