ecto / duino

:bulb: Arduino framework for node.js
958 stars 214 forks source link

throw is evil #9

Closed lwille closed 12 years ago

lwille commented 12 years ago

cf. #8

ecto commented 12 years ago

I really agree with this. However, I think it should still throw if you haven't provided an error handler. Could you append a commit that adds this functionality?

Thanks for your PR man :smile:

lwille commented 12 years ago

the "throw" way (not recommended, as there's no way to catch the error):

board = new duino.Board();

the "event" way:

board = new duino.Board();
board.on('error', function(error){console.error(error)});
richkzad commented 12 years ago

I just ran into this issue too. I have a project that has an optional Arduino component, and if it's not there the project should still keep going.

Would be nice to have this in!

henvic commented 12 years ago

Hi @ecto, are you going to accept this pull request?

I've just tested and it seems okay.