Skip to content

Commit

Permalink
fix(WebSocketManager): properly emit shard error events (#9521)
Browse files Browse the repository at this point in the history
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
  • Loading branch information
didinele and kodiakhq[bot] committed May 5, 2023
1 parent 00da44a commit e627468
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/discord.js/src/client/websocket/WebSocketManager.js
Expand Up @@ -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);
});
}

Expand Down

0 comments on commit e627468

Please sign in to comment.