Clean up a bunch of promise stuff

This commit is contained in:
Schuyler Cebulskie
2016-10-30 12:47:09 -04:00
parent c42e7a15aa
commit 8306d50bd8
12 changed files with 112 additions and 161 deletions

View File

@@ -107,8 +107,7 @@ class VoiceConnection extends EventEmitter {
speaking: true,
delay: 0,
},
})
.catch(e => {
}).catch(e => {
this.emit('debug', e);
});
}
@@ -156,8 +155,7 @@ class VoiceConnection extends EventEmitter {
this.sockets.udp.findEndpointAddress()
.then(address => {
this.sockets.udp.createUDPSocket(address);
})
.catch(e => this.emit('error', e));
}, e => this.emit('error', e));
});
this.sockets.ws.once('sessionDescription', (mode, secret) => {
this.authentication.encryptionMode = mode;

View File

@@ -136,7 +136,7 @@ class StreamDispatcher extends EventEmitter {
const packet = this._createPacket(sequence, timestamp, this.player.opusEncoder.encode(buffer));
while (repeats--) {
this.player.voiceConnection.sockets.udp.send(packet)
.catch(e => this.emit('debug', `failed to send a packet ${e}`));
.catch(e => this.emit('debug', `Failed to send a packet ${e}`));
}
}