fix #1113: return promise inside catch block of reconnect to propagate promise (#1418)

This commit is contained in:
Antonio Campos
2021-06-01 17:58:52 -05:00
committed by GitHub
parent 3afdc1fca0
commit a1edc0b2d5

View File

@@ -390,7 +390,7 @@ export class Connection extends EventEmitter {
*/
private _heartbeat = () => {
return this.request({command: 'ping'}).catch(() => {
this.reconnect().catch((error) => {
return this.reconnect().catch((error) => {
this.emit('error', 'reconnect', error.message, error)
})
})