mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-09 16:13:31 +01:00
fix(WebSocketManager): properly emit shard error events (#9521)
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
This commit is contained in:
@@ -296,14 +296,14 @@ class WebSocketManager extends EventEmitter {
|
||||
shard.ping = latency;
|
||||
});
|
||||
|
||||
this._ws.on(WSWebSocketShardEvents.Error, err => {
|
||||
this._ws.on(WSWebSocketShardEvents.Error, ({ error, shardId }) => {
|
||||
/**
|
||||
* Emitted whenever a shard's WebSocket encounters a connection error.
|
||||
* @event Client#shardError
|
||||
* @param {Error} error The encountered error
|
||||
* @param {number} shardId The shard that encountered this error
|
||||
*/
|
||||
this.client.emit(Events.ShardError, err, err.shardId);
|
||||
this.client.emit(Events.ShardError, error, shardId);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user