mirror of
https://github.com/FranP-code/Baileys.git
synced 2025-10-13 00:32:22 +00:00
minor connect change
This commit is contained in:
@@ -203,9 +203,9 @@ export class WAConnection extends Base {
|
||||
.then (newRef => ref = newRef)
|
||||
.then (emitQR)
|
||||
.then (regenQR)
|
||||
.catch (err => {
|
||||
this.logger.error (`error in QR gen: `, err)
|
||||
if (err.status === 429) { // too many QR requests
|
||||
.catch (error => {
|
||||
this.logger.error ({ error }, `error in QR gen`)
|
||||
if (error.status === 429) { // too many QR requests
|
||||
this.endConnection ()
|
||||
}
|
||||
})
|
||||
|
||||
@@ -34,7 +34,7 @@ export class WAConnection extends Base {
|
||||
lastConnect = new Date()
|
||||
|
||||
const loggedOut = error instanceof BaileysError && UNAUTHORIZED_CODES.includes(error.status)
|
||||
const willReconnect = !loggedOut && (tries <= (options?.maxRetries || 5)) && this.state === 'connecting'
|
||||
const willReconnect = !loggedOut && (tries < options?.maxRetries) && (this.state === 'connecting')
|
||||
const reason = loggedOut ? DisconnectReason.invalidSession : error.message
|
||||
|
||||
this.logger.warn ({ error }, `connect attempt ${tries} failed${ willReconnect ? ', retrying...' : ''}`)
|
||||
|
||||
Reference in New Issue
Block a user