Skip to content

Commit

Permalink
fix(GuildMemberStore): reject BAN_RESOLVE_ID error instead of throwin…
Browse files Browse the repository at this point in the history
…g it (discordjs#3425)
  • Loading branch information
vladfrangu authored and SpaceEEC committed Aug 10, 2019
1 parent d14db52 commit 9e76f23
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/stores/GuildMemberStore.js
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ class GuildMemberStore extends DataStore {
*/
unban(user, reason) {
const id = this.client.users.resolveID(user);
if (!id) throw new Error('BAN_RESOLVE_ID');
if (!id) return Promise.reject(new Error('BAN_RESOLVE_ID'));
return this.client.api.guilds(this.guild.id).bans[id].delete({ reason })
.then(() => this.client.users.resolve(user));
}
Expand Down

0 comments on commit 9e76f23

Please sign in to comment.