fixed an issue with error showing [object Object] instead of actual error

This commit is contained in:
Erik 2020-08-14 17:12:53 +03:00
parent 07d428c952
commit 9dfe472674

View File

@ -138,7 +138,7 @@ class Shard extends EventEmitter {
if(!message || message._eval !== script) return;
child.removeListener('message', listener);
this._evals.delete(script);
if(!message._error) resolve(message._result); else reject(new Error(message._error));
if(!message._error) resolve(message._result); else reject(new Error(message._error.stack));
};
child.on('message', listener);