Log WebSocket constructor error in the console
This commit is contained in:
parent
987f0b3389
commit
1f640a4010
1 changed files with 1 additions and 0 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue