mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-09 16:13:31 +01:00
fix(ShardingManager): client error event cannot be emitted (#5559)
Co-authored-by: monbrey <rsm999@uowmail.edu.au> Co-authored-by: Jan <66554238+vaporox@users.noreply.github.com> Co-authored-by: Vlad Frangu <kingdgrizzle@gmail.com>
This commit is contained in:
@@ -200,13 +200,14 @@ class ShardClientUtil {
|
||||
*/
|
||||
_respond(type, message) {
|
||||
this.send(message).catch(err => {
|
||||
err.message = `Error when sending ${type} response to master process: ${err.message}`;
|
||||
const error = new Error(`Error when sending ${type} response to master process: ${err.message}`);
|
||||
error.stack = err.stack;
|
||||
/**
|
||||
* Emitted when the client encounters an error.
|
||||
* @event Client#error
|
||||
* @param {Error} error The error encountered
|
||||
*/
|
||||
this.client.emit(Events.ERROR, err);
|
||||
this.client.emit(Events.ERROR, error);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user