handle tags via EventEmitter + replace 'intermediate-close' with 'ws-close'

This commit is contained in:
Adhiraj Singh
2020-10-30 17:42:45 +05:30
parent 9366c45842
commit 69da12c33c
9 changed files with 101 additions and 102 deletions

View File

@@ -215,9 +215,9 @@ export class WAConnection extends Base {
emitQR ()
regenQR ()
} catch (error) {
this.logger.error ({ error }, `error in QR gen`)
this.logger.warn ({ error }, `error in QR gen`)
if (error.status === 429) { // too many QR requests
this.rejectPendingConnection (error)
this.emit ('ws-close', { reason: error.message })
}
}
}, this.connectOptions.regenerateQRIntervalMs)