forked from fuson/node-jsonrpc2
-
Notifications
You must be signed in to change notification settings - Fork 41
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
Handling error in connectSocket #53
Comments
@pocesar Following up on this. |
@pocesar Is there a plan to do a refactor or have a fix out? |
@vincentjocodes not in the near future 😞 the refactor is going to be in Typescript |
@pocesar Okay, thank you letting me know, I will see if the user of this package will handle errors from the object being returned rather than through the callback. |
This was referenced Jun 11, 2020
gopherbot
pushed a commit
to golang/vscode-go
that referenced
this issue
Jun 12, 2020
json-rpc2 module doesn't catch all the errors in its callback. If a remote connection fails to be established, it won't call the callback for errors. So the connection will hang. There are no future plans to handle the error case through the callback: json-rpc2: pocesar/node-jsonrpc2#53. Node.js handles errors in a similar way: https://nodejs.org/api/net.html#net_socket_connect. Errors won't be exposed through the callback, only through the error listener. Fixes #215 Change-Id: I75cfb2a0cf6628a8c35ddccf8c96ec1ade0275f1 GitHub-Last-Rev: 44d9b59 GitHub-Pull-Request: #216 Reviewed-on: https://go-review.googlesource.com/c/vscode-go/+/237559 Reviewed-by: Hyang-Ah Hana Kim <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hello,
We are developing a dependency that uses your library and we came across a problem where a connection hangs. I dived more deeply into the problem and noticed that in the
connectSocket
in json-rpc2 function does not call the callback whennet.connection
errors out. Please see the below code forconnectSocket
. Was this intentional? In my testing, if I put this code block under L163, everything works as expected:Happy to send out a Pull Request. Please let me know.
connectSocket:
https://github.com/pocesar/node-jsonrpc2/blob/master/src/client.js#L144
conn:
https://github.com/pocesar/node-jsonrpc2/blob/master/src/client.js#L162
The text was updated successfully, but these errors were encountered: