Closed dangerbacon closed 2 years ago
This reproduces in Chromium, too, so it appears to be a V8 issue. Please file this on: https://bugs.chromium.org/p/chromium/issues/list
Thank you for the follow up! I reproduced in Chrome and filed a V8 bug as you suggested.
Here is the link for anyone in the future who runs across this bug and wants to track it:
In some cases where exceptions are caught and re-thrown in async functions, the vscode debugger does not break on uncaught exceptions. It is easily reproducible with just a few lines of code.
Here is the simplest code I could make to reproduce it:
Run this code with the debugger attached and "uncaught exceptions" checked but "caught exceptions" unchecked. The app will crash, but the debugger will not break on uncaught exception.
Just to verify this behavior is inconsistent with the way that synchronous function exceptions are handled, I created the exact same scenario, but with synchronous functions instead of asynchronous functions:
When you run this nearly-identical code under the exact same circumstances, the debugger DOES break on the re-thrown uncaught exception as it is supposed to do.
I have attached a test JS file with a more complete set of tests you can run to see that it catches the re-thrown exception in most cases, but does not catch the re-thrown exception when it is an async function calling an async function, catching an error, and re-throwing it.
crashtest.js.txt
Tested on: