-
Notifications
You must be signed in to change notification settings - Fork 123
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to return an error from a child #9
Comments
@ryandesign fyi I've seen the issues you've submitted here and I'd love to address them but I'm a little busy right at this moment but I will get to them! You're welcome to open pull requests to try and deal with the things you've raised and I'm happy to steer you through the process of getting it right. |
According to a comment in nodejs/node-v0.x-archive#5727 the communication channel employed by process.send() converts everything to JSON first. So custom object types (like Errors) can't possibly work, since object types aren't represented in JSON. And this pretty much invalidates worker-farm's promise to pass along the arguments unchanged. |
So there seem to be two problems.
|
suggestions for solutions? |
fixed by doing a custom serialisation and deserialisation of Error objects. |
Could you add an example showing how to return an error from a child? I'm trying to call the callback function with a
new Error('...')
object in the first parameter as usual, but although the master process recognizes that there's something in err, it appears to be an empty object, so I can't get any details about the error that occurred.This is with node 0.10.12 on OS X 10.8.4.
The text was updated successfully, but these errors were encountered: