omcaree / node-pololumaestro

Node module for control of Pololu Maestro servo controllers
14 stars 16 forks source link

Don't termintate the process if a device is not found on find method #5

Closed kishu27 closed 10 years ago

kishu27 commented 10 years ago
achingbrain commented 10 years ago

Very grateful for the pull request - thank you for submitting it, but I'm not sure this is the way to do it.

Certainly killing the process isn't ideal and should be removed, but a more node-y approach would be to invoke the passed callback with an Error object as the first argument.

Also, returning true doesn't necessarily guarantee that the onReady callback will ever be invoked (as it's not the responsibility of the find method) so you wouldn't want to rely on that.