Errors Standardization (#1246)

* errors and stuff

* more errors

* all the errors

* fix build
This commit is contained in:
Gus Caplan
2017-06-25 12:48:05 -05:00
committed by Amish Shah
parent 602fe06f88
commit 63e54982f4
28 changed files with 258 additions and 102 deletions

View File

@@ -3,6 +3,7 @@ const Role = require('./Role');
const Permissions = require('../util/Permissions');
const Collection = require('../util/Collection');
const Presence = require('./Presence').Presence;
const { Error } = require('../errors');
/**
* Represents a member of a guild on Discord.
@@ -287,7 +288,7 @@ class GuildMember {
*/
permissionsIn(channel) {
channel = this.client.resolver.resolveChannel(channel);
if (!channel || !channel.guild) throw new Error('Could not resolve channel to a guild channel.');
if (!channel || !channel.guild) throw new Error('GUILD_CHANNEL_RESOLVE');
return channel.permissionsFor(this);
}