-
Notifications
You must be signed in to change notification settings - Fork 33
expose tcp_read/ssl_read errors #713
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
base: master
Are you sure you want to change the base?
Conversation
src/colony/lua_tm.c
Outdated
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.
This is wrong. tm_tcp_read returns errno on error:
https://github.com/tessel/runtime/blob/master/src/posix/tm_net.c#L169
…which at least for the POSIX-defined errors are mandated to have positive values: http://pubs.opengroup.org/onlinepubs/009695399/basedefs/errno.h.html
So: any non-zero value indicates error…the sign of the number should not be checked here, or you will certainly miss errors under POSIX (and probably CC3K too unless it happens to provide negative errno values of its own…).
|
Glad this is getting hooked up — please see comments on patch though for some logic changes necessary to make it work as you intend for the |
src/colony/modules/net.js
Outdated
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.
This is the opposite of staying silent
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.
But yeah, should we have internal code be emitting console.logs if it's just going to throw the error immediately?
|
@jiahuang is this just tying up loose ends, or was the missing error handling related to tessel/t1-firmware#128 too? |
This PR exposes HCI 1008 (select) errors on read so that it can be handled in the JS layer.