From db3e28a0ead2fc7b7b2dee513225de266e13c3f7 Mon Sep 17 00:00:00 2001 From: Steven Liu Date: Thu, 4 Mar 2021 14:43:59 +0000 Subject: [PATCH] lint fix --- rest/src/server/websocketUtils.js | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/rest/src/server/websocketUtils.js b/rest/src/server/websocketUtils.js index f016796d..fe7f3a9f 100644 --- a/rest/src/server/websocketUtils.js +++ b/rest/src/server/websocketUtils.js @@ -46,11 +46,10 @@ module.exports = { client.send(view, err => { if (err) { winston.error(`websocket ${client.uid}: error sending data to websocket`, err); - if (err && err.message) { + if (err.message) client.close(1013, err.message.substring(0, 123)); - } else { + else client.close(); - } } }); }); @@ -77,11 +76,10 @@ module.exports = { const closeWithError = (message, err) => { winston.error(`websocket ${client.uid}: ${message}`, err); - if (err && err.message) { + if (err && err.message) client.close(1013, err.message.substring(0, 123)); - } else { + else client.close(); - } }; client.on('error', err => {