mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-16 19:43:29 +01:00
Improve ShardClientUtil warnings/errors
This commit is contained in:
@@ -119,9 +119,10 @@ class ShardClientUtil {
|
|||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
_respond(type, message) {
|
_respond(type, message) {
|
||||||
this.send(message).catch(err =>
|
this.send(message).catch(err => {
|
||||||
this.client.emit('error', `Error when sending ${type} response to master process: ${err}`)
|
err.message = `Error when sending ${type} response to master process: ${err.message}`;
|
||||||
);
|
this.client.emit('error', err);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -133,7 +134,7 @@ class ShardClientUtil {
|
|||||||
if (!this._singleton) {
|
if (!this._singleton) {
|
||||||
this._singleton = new this(client);
|
this._singleton = new this(client);
|
||||||
} else {
|
} else {
|
||||||
client.emit('error', 'Multiple clients created in child process; only the first will handle sharding helpers.');
|
client.emit('warn', 'Multiple clients created in child process; only the first will handle sharding helpers.');
|
||||||
}
|
}
|
||||||
return this._singleton;
|
return this._singleton;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user