mirror of
https://github.com/danog/telegram-tt.git
synced 2024-12-04 18:50:31 +01:00
GramJs: Add more connection logging
This commit is contained in:
parent
a12d8afb76
commit
7ceff64489
@ -89,8 +89,9 @@ class PromisedWebSockets {
|
|||||||
reject(error);
|
reject(error);
|
||||||
};
|
};
|
||||||
this.client.onclose = (event) => {
|
this.client.onclose = (event) => {
|
||||||
|
const { code, reason, wasClean } = event;
|
||||||
// eslint-disable-next-line no-console
|
// eslint-disable-next-line no-console
|
||||||
console.error(`Socket closed with code: ${event.code}`);
|
console.error(`Socket ${ip} closed. Code: ${code}, reason: ${reason}, was clean: ${wasClean}`);
|
||||||
this.resolveRead(false);
|
this.resolveRead(false);
|
||||||
this.closed = true;
|
this.closed = true;
|
||||||
};
|
};
|
||||||
|
@ -182,7 +182,9 @@ class MTProtoSender {
|
|||||||
if (this._updateCallback && attempt === 0) {
|
if (this._updateCallback && attempt === 0) {
|
||||||
this._updateCallback(new UpdateConnectionState(UpdateConnectionState.disconnected));
|
this._updateCallback(new UpdateConnectionState(UpdateConnectionState.disconnected));
|
||||||
}
|
}
|
||||||
this._log.error(`WebSocket connection failed attempt: ${attempt + 1}. Cause: ${err.message}`);
|
this._log.error(`WebSocket connection failed attempt: ${attempt + 1}`);
|
||||||
|
// eslint-disable-next-line no-console
|
||||||
|
console.error(err);
|
||||||
await Helpers.sleep(this._delay);
|
await Helpers.sleep(this._delay);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user