mirror of
https://github.com/FranP-code/Baileys.git
synced 2025-10-13 00:32:22 +00:00
regen QR call rejectPending
This commit is contained in:
@@ -208,7 +208,7 @@ export class WAConnection extends Base {
|
||||
this.qrTimeout = setTimeout (async () => {
|
||||
if (this.state === 'open') return
|
||||
|
||||
this.logger.debug ('regenerated QR')
|
||||
this.logger.debug ('regenerating QR')
|
||||
try {
|
||||
const newRef = await this.generateNewQRCodeRef ()
|
||||
ref = newRef
|
||||
@@ -217,7 +217,7 @@ export class WAConnection extends Base {
|
||||
} catch (error) {
|
||||
this.logger.error ({ error }, `error in QR gen`)
|
||||
if (error.status === 429) { // too many QR requests
|
||||
this.endConnection ()
|
||||
this.rejectPendingConnection (error)
|
||||
}
|
||||
}
|
||||
}, this.connectOptions.regenerateQRIntervalMs)
|
||||
|
||||
@@ -341,7 +341,7 @@ export class WAConnection extends Base {
|
||||
this.logger.debug({ unhandled: true }, messageTag + ',' + JSON.stringify(json))
|
||||
}
|
||||
} catch (error) {
|
||||
this.logger.error ({ error }, `encountered error in decrypting message, closing`)
|
||||
this.logger.error ({ error }, `encountered error in decrypting message, closing: ${error}`)
|
||||
|
||||
if (this.state === 'open') this.unexpectedDisconnect (DisconnectReason.badSession)
|
||||
else this.rejectPendingConnection (new Error(DisconnectReason.badSession))
|
||||
|
||||
Reference in New Issue
Block a user