Skip to content

Conversation

@jiahuang
Copy link
Contributor

This PR exposes HCI 1008 (select) errors on read so that it can be handled in the JS layer.

Copy link
Contributor

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…).

@natevw
Copy link
Contributor

natevw commented Feb 13, 2015

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 tcp case especially.

Copy link
Member

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

Copy link
Member

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?

@natevw
Copy link
Contributor

natevw commented Feb 27, 2015

@jiahuang is this just tying up loose ends, or was the missing error handling related to tessel/t1-firmware#128 too?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants