mirror of
https://github.com/FranP-code/Baileys.git
synced 2025-10-13 00:32:22 +00:00
fix: handle errors in validateconnection
This commit is contained in:
@@ -425,7 +425,14 @@ export const makeSocket = ({
|
||||
}
|
||||
|
||||
ws.on('message', onMessageRecieved)
|
||||
ws.on('open', validateConnection)
|
||||
ws.on('open', async() => {
|
||||
try {
|
||||
await validateConnection()
|
||||
} catch(err) {
|
||||
logger.error({ err }, 'error in validating connection')
|
||||
end(err)
|
||||
}
|
||||
})
|
||||
ws.on('error', error => end(
|
||||
new Boom(
|
||||
`WebSocket Error (${error.message})`,
|
||||
|
||||
Reference in New Issue
Block a user