ready event will now throw errors properly (#1440)

This commit is contained in:
Drahcirius
2017-05-01 03:43:35 -04:00
committed by Amish Shah
parent 892ba67d71
commit 166161d6d3
2 changed files with 4 additions and 9 deletions

View File

@@ -99,11 +99,7 @@ class WebSocketPacketManager {
}
if (!queue && this.queue.length > 0) this.handleQueue();
try {
if (this.handlers[packet.t]) return this.handlers[packet.t].handle(packet);
} catch (error) {
this.client.emit(Constants.Events.ERROR, error);
}
if (this.handlers[packet.t]) return this.handlers[packet.t].handle(packet);
return false;
}
}