chore(core): added logs for key-change failure
This commit is contained in:
parent
1b5760b3fc
commit
c536086310
1 changed files with 8 additions and 2 deletions
|
@ -320,7 +320,10 @@ export class DcConnectionManager {
|
||||||
this.download.notifyKeyChange()
|
this.download.notifyKeyChange()
|
||||||
this.downloadSmall.notifyKeyChange()
|
this.downloadSmall.notifyKeyChange()
|
||||||
})
|
})
|
||||||
.catch((e: Error) => this.manager.params.emitError(e))
|
.catch((e: Error) => {
|
||||||
|
this.manager._log.warn('failed to save auth key for dc %d: %s', this.dcId, e)
|
||||||
|
this.manager.params.emitError(e)
|
||||||
|
})
|
||||||
})
|
})
|
||||||
connection.on('tmp-key-change', (idx: number, key: Uint8Array | null, expires: number) => {
|
connection.on('tmp-key-change', (idx: number, key: Uint8Array | null, expires: number) => {
|
||||||
if (kind !== 'main') {
|
if (kind !== 'main') {
|
||||||
|
@ -342,7 +345,10 @@ export class DcConnectionManager {
|
||||||
this.download.notifyKeyChange()
|
this.download.notifyKeyChange()
|
||||||
this.downloadSmall.notifyKeyChange()
|
this.downloadSmall.notifyKeyChange()
|
||||||
})
|
})
|
||||||
.catch((e: Error) => this.manager.params.emitError(e))
|
.catch((e: Error) => {
|
||||||
|
this.manager._log.warn('failed to save temp auth key %d for dc %d: %s', idx, this.dcId, e)
|
||||||
|
this.manager.params.emitError(e)
|
||||||
|
})
|
||||||
})
|
})
|
||||||
connection.on('future-salts', (salts: mtp.RawMt_future_salt[]) => {
|
connection.on('future-salts', (salts: mtp.RawMt_future_salt[]) => {
|
||||||
Promise.resolve(this.manager._storage.salts.store(this.dcId, salts)).catch((e: Error) =>
|
Promise.resolve(this.manager._storage.salts.store(this.dcId, salts)).catch((e: Error) =>
|
||||||
|
|
Loading…
Reference in a new issue