mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-13 01:53:30 +01:00
Fix transmitting errors through IPC
This commit is contained in:
@@ -4,6 +4,7 @@ const EventEmitter = require('events').EventEmitter;
|
||||
|
||||
const Shard = require('./Shard');
|
||||
const Collection = require('../util/Collection');
|
||||
const makePlainError = require('../util/MakePlainError');
|
||||
|
||||
/**
|
||||
* This is a utility class that can be used to help you spawn shards of your Client. Each shard is completely separate
|
||||
@@ -58,11 +59,11 @@ class ShardingManager extends EventEmitter {
|
||||
if (message._sFetchProp) {
|
||||
this.fetchClientValues(message._sFetchProp)
|
||||
.then(results => shard.send({ _sFetchProp: message._sFetchProp, _result: results }))
|
||||
.catch(err => shard.send({ _sFetchProp: message._sFetchProp, _error: err }));
|
||||
.catch(err => shard.send({ _sFetchProp: message._sFetchProp, _error: makePlainError(err) }));
|
||||
} else if (message._sEval) {
|
||||
this.broadcastEval(message._sEval)
|
||||
.then(results => shard.send({ _sEval: message._sEval, _result: results }))
|
||||
.catch(err => shard.send({ _sEval: message._sEval, _error: err }));
|
||||
.catch(err => shard.send({ _sEval: message._sEval, _error: makePlainError(err) }));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user