From 215081240f367ee39f785443a9200dfff4dfff57 Mon Sep 17 00:00:00 2001
From: Emelia Smith <ThisIsMissEm@users.noreply.github.com>
Date: Sat, 10 Jun 2023 18:35:57 +0200
Subject: [PATCH] Add logging of websocket send errors (#25280)

---
 streaming/index.js | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/streaming/index.js b/streaming/index.js
index 9b43112d22..aabd2f8559 100644
--- a/streaming/index.js
+++ b/streaming/index.js
@@ -828,7 +828,11 @@ const startServer = async () => {
       return;
     }
 
-    ws.send(JSON.stringify({ stream: streamName, event, payload }));
+    ws.send(JSON.stringify({ stream: streamName, event, payload }), (err) => {
+      if (err) {
+        log.error(req.requestId, `Failed to send to websocket: ${err}`);
+      }
+    });
   };
 
   /**
-- 
GitLab