node-worker-nodes icon indicating copy to clipboard operation
node-worker-nodes copied to clipboard

fail not catched when error is unserializable

Open kapouer opened this issue 3 years ago • 0 comments

Hi, i happen to call browserify in a worker node: upon failure it returns an error with a lot of additional structures. It took me a while to realize I had to rewrite the error using:

const err2 = new Error(err.message);
err2.code = err.code;
err2.stack = err.stack;
reject(err2);

i wonder if there is a way for worker-nodes to avoid the headache.

kapouer avatar May 10 '21 08:05 kapouer