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

New Uncaught Exception when starting an extension debugging session #24482

Closed
eamodio opened this issue Apr 11, 2017 · 13 comments
Closed

New Uncaught Exception when starting an extension debugging session #24482

eamodio opened this issue Apr 11, 2017 · 13 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug debug Debug viewlet, configurations, breakpoints, adapter issues verification-needed Verification of issue is requested verified Verification succeeded
Milestone

Comments

@eamodio
Copy link
Contributor

eamodio commented Apr 11, 2017

  • VSCode Version: Code - Insiders 1.12.0-insider (a5e9d3b, 2017-04-11T06:05:26.421Z)
  • OS Version: Darwin x64 16.5.0

Steps to Reproduce:

  1. Open an extension
  2. Start debugging (make sure to have Uncaught Exceptions on)

image

I've also seen the same error when trying to debug the API tests in the VSCode project

@joaomoreno
Copy link
Member

@eamodio This promise is handled. Just look at line 98.

@eamodio
Copy link
Contributor Author

eamodio commented Apr 11, 2017

@joaomoreno Sorry I should have been clearer. I definitely agree that the exception is handled, but for some reason vscode breaks on that line -- like shown in the screenshot every time it starts up and I don't have break on all exceptions on and it just started happened with the previous insiders build than I reported it on (since there was an update in between).

@joaomoreno joaomoreno reopened this Apr 11, 2017
@joaomoreno joaomoreno assigned weinand and unassigned joaomoreno Apr 11, 2017
@joaomoreno
Copy link
Member

joaomoreno commented Apr 11, 2017

@weinand A Promise.reject(null) seems to break the debugger independently of whether the user has Break on all exceptions. Is this an issue with the Node debug adapter?

@weinand weinand added debug Debug viewlet, configurations, breakpoints, adapter issues bug Issue identified by VS Code Team member as probable bug labels Apr 11, 2017
@weinand weinand added this to the April 2017 milestone Apr 11, 2017
@weinand
Copy link
Contributor

weinand commented Apr 11, 2017

dup of #1746

@weinand weinand closed this as completed Apr 11, 2017
@weinand weinand added the *duplicate Issue identified as a duplicate of another issue(s) label Apr 11, 2017
@weinand weinand removed this from the April 2017 milestone Apr 11, 2017
@eamodio
Copy link
Contributor Author

eamodio commented Apr 11, 2017

@weinand was there a switch to the something new in the insiders build? Because I don't see this same behavior in 1.11.1 and it just started 2 build ago for me.

@weinand
Copy link
Contributor

weinand commented Apr 11, 2017

@eamodio no, there was no change in that area (and I can reproduce the issue in 1.11.1 too).
Could it be that you have turned off both exception settings in 1.11.1?

2017-04-11_17-58-19

With both settings off, VS Code will not break.

@eamodio
Copy link
Contributor Author

eamodio commented Apr 11, 2017

@weinand Had me worried for a minute there ;) but no, I have Uncaught Exceptions checked in both 1.11.1 and today's insiders and only the insiders build breaks at that reject line.

EDIT: Was also worried that I didn't have the Preview SCM enabled in 1.11.1 but I just verified that I do.

@weinand
Copy link
Contributor

weinand commented Apr 11, 2017

Aha, I see that you are doing extension development and you are using Electron's builtin node.js.

We have upgraded the Electron used in Insiders and that seems to have changed the way "rejects" are surfaced. So it looks like the node.js built into Electron now has the same "reject" behaviour as the regular node.js.

For extension debugging I will enable the fix that I've already implemented some time ago (but was reluctant to enable it for general node debugging; see my comment #1746 (comment))

@weinand weinand reopened this Apr 11, 2017
@weinand weinand removed the *duplicate Issue identified as a duplicate of another issue(s) label Apr 11, 2017
@weinand weinand added this to the April 2017 milestone Apr 11, 2017
@weinand
Copy link
Contributor

weinand commented Apr 11, 2017

In tomorrows Insiders build rejects should no longer break.

@weinand
Copy link
Contributor

weinand commented Apr 21, 2017

I've added an option for enabling/disabling rejects:

2017-04-21_10-20-42

@weinand weinand added the verification-needed Verification of issue is requested label Apr 25, 2017
@jrieken jrieken added the verified Verification succeeded label Apr 26, 2017
@subatomicglue
Copy link

@weinand How do we enable this "Promise Rejects" feature? I noticed it documented in the new release here: https://code.visualstudio.com/updates/v1_12, and I am running 1.12.1 now... But all I see under breakpoints is "All Exceptions" and "Uncaught Exceptions". Here's my launch.json:

{
         "type": "node",
         "request": "launch",
         "name": "Launch NodeJS",
         "program": "${workspaceRoot}/back/src/app.js",
         "cwd": "${workspaceRoot}/back",
         "runtimeArgs": ["--harmony-async-await"],
         //"runtimeExecutable": "/usr/local/bin/node",
         "skipFiles": [
            "<node_internals>/**/*.js"
          ],
          "showAsyncStacks": true,
          "protocol": "inspector" // auto, legacy, inspector
      },

@weinand
Copy link
Contributor

weinand commented May 5, 2017

@subatomicglue this new exception config option is only available for extension host debugging, that is "type": "extensionHost".

@weinand
Copy link
Contributor

weinand commented Aug 14, 2017

After switching EH debugging to "inspector" protocol, we are running now into the same issue we had for "legacy":

2017-08-14_10-38-49

I suggest to fix it in the same way I did for "legacy" (and since we both know that the 'reject' detection heuristic is a bit of a hack, this exception config option only shows up for debug type "extensionHost").

I've created microsoft/vscode-node-debug2#132 to track this.

@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 18, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug debug Debug viewlet, configurations, breakpoints, adapter issues verification-needed Verification of issue is requested verified Verification succeeded
Projects
None yet
Development

No branches or pull requests

5 participants