-
Notifications
You must be signed in to change notification settings - Fork 68
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
Some fixes using with callbacks #11
Conversation
brugnara
commented
Sep 15, 2014
- Catched error if trying to open a non existent modem that causes exception trying to close a non opened port.
- calling callback(error) on errors.
- null pointer exception
Call callback if exists and on error!
fix null pointer exception.
@@ -102,12 +102,15 @@ var createModem = function() { | |||
|
|||
modem.port.on('error', function() { | |||
modem.close(); | |||
callback && callback(new Error('Serial port error')); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@brugnara Sure, I will merge the pull request, just, please change the Error to string and I'll just merge it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@emilsedgh done. I think we should talk a bit and do a branch where we can do a huge refactor fixing what we said tomorrow. 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@brugnara My email address is emilsedgh@kde.org
You can also find me on IRC, I'm emilsedgh on Freenode and I usually hang out on #Node.js
returning string instead of error
changed returning error string
Fixed timeout on commands
Refixed throw
I've closed this issue because of the number of fixes that this module needs. It is very unstable and it is not usable on production on current state. I've rewritten a new one, called node-modem that fully works with callbacks, handling errors and timeouts. |