mirror of
https://github.com/danog/telegram-tt.git
synced 2024-12-03 10:07:55 +01:00
GramJs: Add more connection logging
This commit is contained in:
parent
a12d8afb76
commit
7ceff64489
@ -89,8 +89,9 @@ class PromisedWebSockets {
|
||||
reject(error);
|
||||
};
|
||||
this.client.onclose = (event) => {
|
||||
const { code, reason, wasClean } = event;
|
||||
// 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.closed = true;
|
||||
};
|
||||
|
@ -182,7 +182,9 @@ class MTProtoSender {
|
||||
if (this._updateCallback && attempt === 0) {
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user