diff --git a/src/client/websocket/WebSocketShard.js b/src/client/websocket/WebSocketShard.js index ed5a73d1e9bf..2db3bd056a85 100644 --- a/src/client/websocket/WebSocketShard.js +++ b/src/client/websocket/WebSocketShard.js @@ -291,12 +291,12 @@ class WebSocketShard extends EventEmitter { let packet; try { 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) { this.manager.client.emit(Events.SHARD_ERROR, err, this.id); 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); }