From 5bd3184ebf7c7732d46722acc8f5e8d362e07524 Mon Sep 17 00:00:00 2001 From: Adam Stachowicz Date: Sun, 18 Jul 2021 20:59:00 +0200 Subject: [PATCH] Use connect_error event --- src/mixins/socket.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/mixins/socket.js b/src/mixins/socket.js index 44108992..cf7cb121 100644 --- a/src/mixins/socket.js +++ b/src/mixins/socket.js @@ -46,9 +46,9 @@ export default { transports: ['websocket'] }); - if (!socket.connected) { - console.error("Failed to connect to the backend") - } + socket.on("connect_error", (err) => { + console.error(`Failed to connect to the backend. Socket.io connect_error: ${err.message}`); + }); socket.on('info', (info) => { this.info = info;