From 1f640a401024860d7051d6f859e18b11896dfbcd Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Fri, 22 Jan 2021 20:59:17 +0100 Subject: [PATCH] Log WebSocket constructor error in the console --- lib/client.js | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/client.js b/lib/client.js index e8b42f7..ed7083d 100644 --- a/lib/client.js +++ b/lib/client.js @@ -59,6 +59,7 @@ export default class Client extends EventTarget { try { this.ws = new WebSocket(this.params.url); } catch (err) { + console.error("Failed to create connection:", err); setTimeout(() => { this.dispatchEvent(new CustomEvent("error", { detail: "Failed to create connection: " + err })); this.setStatus(Client.Status.DISCONNECTED);