-
Notifications
You must be signed in to change notification settings - Fork 70
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
Error handling #203
Comments
@jonathan-roy, the steam error event is the right way to detect stream errors associated any normal stream communication errors in node. however, when we wrote this module, we never thought to emit connection or other errs from the clib layer correctly (in the idiomatic node way that you're referencing). I'm open to review a PR request if you would like to take stab at fixing this. You would need to make sure to call Socket's |
what exact type of connection error are you trying to detect?
there's no way to detect disconnect. sometimes Node.JS TCP/HTTP or other TCP libraries will consider an unexpected client disconnect as "connection error". These connection "errors" are deliberately ignored by the library and sockets are designed to gracefully attempt reconnections without surfacing anything like err to application |
Thank you for your answer @reqshark. Graceful reconnection attempts are a good thing but I think that an optional maximum number of reconnection attempts which, once reached, gives an error, could be interesting. This way, the UI or client can have a clue that something is not correctly working (take as an example an attempt to connect to an unknown host). |
Hi,
Is there a way to detect connection/communication errors? For example, it seems like
connect()
should return a negative integer on failure, but the following always return1
:I also tried to listen for errors:
But it never fires, so what is the proper way to catch connection/communication errors?
The text was updated successfully, but these errors were encountered: