From 432301e5650d8e5a15cc721dccc59e0fcdfb2fee Mon Sep 17 00:00:00 2001 From: pabloFuente Date: Thu, 8 Jul 2021 15:31:01 +0200 Subject: [PATCH] openvidu-server: warn instead of error when websocket has been closed by client --- .../io/openvidu/server/rpc/RpcNotificationService.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/openvidu-server/src/main/java/io/openvidu/server/rpc/RpcNotificationService.java b/openvidu-server/src/main/java/io/openvidu/server/rpc/RpcNotificationService.java index 07b88a66..f4d5c46b 100644 --- a/openvidu-server/src/main/java/io/openvidu/server/rpc/RpcNotificationService.java +++ b/openvidu-server/src/main/java/io/openvidu/server/rpc/RpcNotificationService.java @@ -24,6 +24,7 @@ import java.util.concurrent.Executors; import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.TimeUnit; +import org.kurento.commons.exception.KurentoException; import org.kurento.jsonrpc.Session; import org.kurento.jsonrpc.Transaction; import org.kurento.jsonrpc.message.Request; @@ -109,6 +110,15 @@ public class RpcNotificationService { try { s.sendNotification(method, params); + } catch (KurentoException e) { + if (e.getCause().getMessage() + .contains("been closed and no method (apart from close()) may be called on a closed session")) { + log.warn("Notification '{}' couldn't be sent to participant with privateId {}: {}", method, + participantPrivateId, e.getCause().getMessage()); + } else { + log.error("Exception sending notification '{}': {} to participant with private id {}", method, params, + participantPrivateId, e); + } } catch (Exception e) { log.error("Exception sending notification '{}': {} to participant with private id {}", method, params, participantPrivateId, e);