mirror of
https://github.com/FranP-code/Baileys.git
synced 2025-10-13 00:32:22 +00:00
fix: listen to all failure messages
This commit is contained in:
@@ -471,9 +471,10 @@ export const makeSocket = ({
|
|||||||
const statusCode = +(node.attrs.code || DisconnectReason.restartRequired)
|
const statusCode = +(node.attrs.code || DisconnectReason.restartRequired)
|
||||||
end(new Boom('Stream Errored', { statusCode, data: node }))
|
end(new Boom('Stream Errored', { statusCode, data: node }))
|
||||||
})
|
})
|
||||||
// logged out
|
// stream fail, possible logout
|
||||||
ws.on('CB:failure,reason:401', () => {
|
ws.on('CB:failure', (node: BinaryNode) => {
|
||||||
end(new Boom('Logged Out', { statusCode: DisconnectReason.loggedOut }))
|
const reason = +(node.attrs.reason || 500)
|
||||||
|
end(new Boom('Connection Failure', { statusCode: reason, data: node.attrs }))
|
||||||
})
|
})
|
||||||
process.nextTick(() => {
|
process.nextTick(() => {
|
||||||
ev.emit('connection.update', { connection: 'connecting', receivedPendingNotifications: false, qr: undefined })
|
ev.emit('connection.update', { connection: 'connecting', receivedPendingNotifications: false, qr: undefined })
|
||||||
|
|||||||
Reference in New Issue
Block a user