Skip to content

Commit

Permalink
fix(ShardingManager): client error event cannot be emitted (#5559)
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
4 people committed Jun 7, 2021
1 parent 65dc00f commit d1c5b6f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/sharding/ShardClientUtil.js
Expand Up @@ -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);
});
}

Expand Down

0 comments on commit d1c5b6f

Please sign in to comment.