-
Notifications
You must be signed in to change notification settings - Fork 22
Open
Description
Just something to remember... in https://github.com/pinojs/thread-stream/blob/main/lib/worker.js, when the destination error event is emitted, an 'ERROR' message is posted back to the origin thread...
https://github.com/pinojs/thread-stream/blob/main/lib/worker.js#L21-L26:
destination.on('error', function (err) {
parentPort.postMessage({
code: 'ERROR',
err
})
})
Error
objects can be a bit odd in the structured clone algorithm. If err
is a custom error object (e.g. something like Node.js DOMException
or something like class MyError extends Error
, what comes out on the other side will not match exactly. It will certainly clone as an Error
, but you'll lose the custom extension on it.
mcollina
Metadata
Metadata
Assignees
Labels
No labels