lib/client: log close code

This commit is contained in:
Simon Ser committed 2021-03-03 18:30:15 +01:00
1 parent aa79067179
commit 6430fa252a
1 file changed
+3 -2
+3 -2
View File
@@ -70,8 +70,9 @@ export default class Client extends EventTarget {
this.ws.addEventListener("open", this.handleOpen.bind(this));
this.ws.addEventListener("message", this.handleMessage.bind(this));
this.ws.addEventListener("close", () => {
console.log("Connection closed");
this.ws.addEventListener("close", (event) => {
console.log("Connection closed (code: " + event.code + ")");
this.ws = null;
this.setStatus(Client.Status.DISCONNECTED);
this.availableCaps = {};