fix: require discordjserror to throw meaningful errors where necessary

This commit is contained in:
Pascal
2018-01-22 20:23:36 +01:00
parent 86da7af4f1
commit 07c48a6845
9 changed files with 11 additions and 5 deletions

View File

@@ -23,7 +23,7 @@ class PacketHandler extends EventEmitter {
buffer.copy(nonce, 0, 0, 12);
let packet = secretbox.methods.open(buffer.slice(12), nonce, this.receiver.connection.authentication.secretKey);
if (!packet) return Error('Failed to decrypt voice packet');
if (!packet) return new Error('Failed to decrypt voice packet');
packet = Buffer.from(packet);
// Strip RTP Header Extensions (one-byte only)