mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-12 17:43:30 +01:00
ready event will now throw errors properly (#1440)
This commit is contained in:
@@ -273,12 +273,11 @@ class WebSocketConnection extends EventEmitter {
|
||||
*/
|
||||
onMessage(event) {
|
||||
try {
|
||||
this.onPacket(this.unpack(event.data));
|
||||
return true;
|
||||
event.data = this.unpack(event.data);
|
||||
} catch (err) {
|
||||
this.debug(err);
|
||||
return false;
|
||||
this.emit('debug', err);
|
||||
}
|
||||
return this.onPacket(event.data);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user