mirror of
https://github.com/danbulant/discord.js
synced 2026-06-08 01:01:30 +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
|
* @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;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue