Fix Hyper's error and make it more useful

This commit is contained in:
Schuyler Cebulskie
2016-10-16 20:58:03 -04:00
parent 0b5ef296cb
commit 13aae621b8
2 changed files with 3 additions and 1 deletions

View File

@@ -265,7 +265,8 @@ class WebSocketManager extends EventEmitter {
if (this.client.options.fetchAllMembers) {
const promises = this.client.guilds.array().map(g => g.fetchMembers());
Promise.all(promises).then(() => this._emitReady()).catch(e => {
this.client.emit(Constants.Event.WARN, `Error on pre-ready guild member fetching - ${e}`);
this.client.emit(Constants.Events.WARN, 'Error in pre-ready guild member fetching');
this.client.emit(Constants.Events.ERROR, e);
this._emitReady();
});
return;

View File

@@ -190,6 +190,7 @@ exports.Events = {
TYPING_STOP: 'typingStop',
DISCONNECT: 'disconnect',
RECONNECTING: 'reconnecting',
ERROR: 'error',
WARN: 'warn',
DEBUG: 'debug',
};