mirror of
https://github.com/danbulant/discord.js
synced 2026-05-25 04:52:22 +00:00
Improve ShardClientUtil warnings/errors
This commit is contained in:
parent
b177aefdd6
commit
a0de75f290
1 changed files with 5 additions and 4 deletions
|
|
@ -119,9 +119,10 @@ class ShardClientUtil {
|
|||
* @private
|
||||
*/
|
||||
_respond(type, message) {
|
||||
this.send(message).catch(err =>
|
||||
this.client.emit('error', `Error when sending ${type} response to master process: ${err}`)
|
||||
);
|
||||
this.send(message).catch(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) {
|
||||
this._singleton = new this(client);
|
||||
} 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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue