mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-14 18:43:31 +01:00
fix(WebSocketShard): don't catch errors thrown in event handlers (#5803)
This commit is contained in:
@@ -291,12 +291,12 @@ class WebSocketShard extends EventEmitter {
|
|||||||
let packet;
|
let packet;
|
||||||
try {
|
try {
|
||||||
packet = WebSocket.unpack(raw);
|
packet = WebSocket.unpack(raw);
|
||||||
this.manager.client.emit(Events.RAW, packet, this.id);
|
|
||||||
if (packet.op === OPCodes.DISPATCH) this.manager.emit(packet.t, packet.d, this.id);
|
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
this.manager.client.emit(Events.SHARD_ERROR, err, this.id);
|
this.manager.client.emit(Events.SHARD_ERROR, err, this.id);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
this.manager.client.emit(Events.RAW, packet, this.id);
|
||||||
|
if (packet.op === OPCodes.DISPATCH) this.manager.emit(packet.t, packet.d, this.id);
|
||||||
this.onPacket(packet);
|
this.onPacket(packet);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user