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:
DD
2023-05-05 23:17:05 +03:00
committed by GitHub
parent 00da44a120
commit e6274681fd

View File

@@ -296,14 +296,14 @@ class WebSocketManager extends EventEmitter {
shard.ping = latency; 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. * Emitted whenever a shard's WebSocket encounters a connection error.
* @event Client#shardError * @event Client#shardError
* @param {Error} error The encountered error * @param {Error} error The encountered error
* @param {number} shardId The shard that encountered this 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);
}); });
} }