Skip to content
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

debug: show errors when remote connection fails #215

Closed
vjocw opened this issue Jun 11, 2020 · 4 comments
Closed

debug: show errors when remote connection fails #215

vjocw opened this issue Jun 11, 2020 · 4 comments
Labels
Debug Issues related to the debugging functionality of the extension. FrozenDueToAge

Comments

@vjocw
Copy link
Contributor

vjocw commented Jun 11, 2020

What version of Go, VS Code & VS Code Go extension are you using?

  • Run go version to get version of Go
    • go version go1.14.3 darwin/amd64
  • Run code -v or code-insiders -v to get version of VS Code or VS Code Insiders
    • 1.46.0
  • Check your installed extensions to get the version of the VS Code Go extension
    • v0.14.4

Describe the bug

json-rpc2 module doesn't catch all the errors in its callback in this line of code: https://github.com/golang/vscode-go/blob/master/src/debugAdapter/goDebug.ts#L597.

Basically if a remote connection fails, it won't call the callback for errors. So the connection hangs when we use vscode-go debugger. There is no future plan to handle this case: pocesar/node-jsonrpc2#53.

One way I've experimented and had success with is something like:

client.on('error', (error) => {
     reject(error);
});
@stamblerre stamblerre changed the title When remote connection fails, no errors raised debug: show errors when remote connection fails Jun 11, 2020
@stamblerre stamblerre added the Debug Issues related to the debugging functionality of the extension. label Jun 11, 2020
@stamblerre
Copy link
Contributor

Thanks for this report and investigation, @vincentjocodes! Feel free to contribute your patch, if you're interested in doing so.

@hyangah
Copy link
Contributor

hyangah commented Jun 11, 2020

There is an issue for replacing json-rpc2 #113
Will the new library surface the underlying connection errors better?

@vjocw
Copy link
Contributor Author

vjocw commented Jun 11, 2020

@stamblerre Just did a patch, please take a look. #216. Thanks!

@gopherbot
Copy link
Collaborator

Change https://golang.org/cl/237559 mentions this issue: adds error handling for remote connections

@golang golang locked and limited conversation to collaborators Jun 12, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Debug Issues related to the debugging functionality of the extension. FrozenDueToAge
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants