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

@@ -110,7 +110,7 @@ class ShardingManager extends EventEmitter {
fetchRecommendedShards(this.token).then(count => {
this.totalShards = count;
resolve(this._spawn(count, delay));
}).catch(reject);
}, reject);
} else {
if (typeof amount !== 'number' || isNaN(amount)) throw new TypeError('Amount of shards must be a number.');
if (amount < 1) throw new RangeError('Amount of shards must be at least 1.');