mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-12 09:33:32 +01:00
Replace a few rejections with throw (#590)
This commit is contained in:
committed by
Amish Shah
parent
44b34154e8
commit
64d89b3748
@@ -196,8 +196,7 @@ class ClientDataResolver {
|
||||
const file = path.resolve(resource);
|
||||
const stat = fs.statSync(file);
|
||||
if (!stat.isFile()) {
|
||||
reject(new Error(`The file could not be found: ${file}`));
|
||||
return;
|
||||
throw new Error(`The file could not be found: ${file}`);
|
||||
}
|
||||
|
||||
fs.readFile(file, (err, data) => {
|
||||
|
||||
@@ -104,8 +104,7 @@ class ClientVoiceManager {
|
||||
joinChannel(channel) {
|
||||
return new Promise((resolve, reject) => {
|
||||
if (this.pending.get(channel.guild.id)) {
|
||||
reject(new Error('already connecting to a channel in this guild'));
|
||||
return;
|
||||
throw new Error('already connecting to a channel in this guild');
|
||||
}
|
||||
const existingConn = this.connections.get(channel.guild.id);
|
||||
if (existingConn) {
|
||||
|
||||
Reference in New Issue
Block a user