-
Notifications
You must be signed in to change notification settings - Fork 34.9k
Description
Problem
It is often challenging to narrow the emitter of an exception using node + vscode tooling. For example, many node internals throw exceptions often, as do userland libraries. skipFiles
is a noble attempt that helps to aide with this problem, but requires that the user collect possibly large domains of possible paths up front, where often it is unknown whom is responsible for emitting an exception. As suggested in similar threads, I cannot reasonably use <node_internals>
in my skipFiles, as code that is-on-the-fly compiled is put into VM scripts, and is thus ignored. Further, in some cases, i'm OK breaking inside of internals. During daily debugging, I have knowledge about an exception (perhaps stderr output from a prior run), that I really want to hone in on--and thus want a conditional breakpoint to rapidly narrow my search.
This feature would add a mechanism like conditional breakpoints, but just to exceptions. Perhaps it would be as follows:
- select
[x] All exceptions
in the debugger - right click => add condition
- observe placeholder prompt "
err =>
- user fills in function
- user hits enter to save the function
err => err && err.message.match(/react/)
the need for a lamba here is because the exception of course isn't otherwise in scope--providing a function lets us introspect the error.