Vscode: New Uncaught Exception when starting an extension debugging session

Created on 11 Apr 2017  路  13Comments  路  Source: microsoft/vscode

  • VSCode Version: Code - Insiders 1.12.0-insider (a5e9d3b5e8e7e9a89dd6624a70aab031f189a6fa, 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

bug debug verification-needed verified

Most helpful comment

In tomorrows Insiders build rejects should no longer break.

All 13 comments

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

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

@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 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.

@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.

@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.

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 https://github.com/Microsoft/vscode/issues/1746#issuecomment-255617404)

In tomorrows Insiders build rejects should no longer break.

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

2017-04-21_10-20-42

@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
      },

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

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 https://github.com/Microsoft/vscode-node-debug2/issues/132 to track this.

Was this page helpful?
0 / 5 - 0 ratings