vscode-java-debug icon indicating copy to clipboard operation
vscode-java-debug copied to clipboard

Allow to break on caught/uncaught exceptions by name or package namespace

Open testforstephen opened this issue 2 years ago • 1 comments

"Ability to set exception breakpoint by name would be great. Caught / uncaught exception is not enough."

testforstephen avatar Jun 04 '22 14:06 testforstephen

Customer Verbatim: I like the feature from other IDE where you set a exception break point by setting the particular exception we want to break on"

testforstephen avatar Sep 06 '22 02:09 testforstephen

This has been supported in 0.50.0 version.

Here is how to enable exception breakpoint on the specified exception type:

  1. Configure the exception types in the setting java.debug.settings.exceptionBreakpoint.exceptionTypes.
    "java.debug.settings.exceptionBreakpoint.exceptionTypes": [
       "java.lang.NullPointerException" // fully qualified class name
    ]
  1. Go to Breakpoint view, toggle the CaughtException or UncaughtException. image

testforstephen avatar Apr 26 '23 02:04 testforstephen

Thank you for implementing this but I still don't get how it should work. I want to set an exception breakpoint so that it will alway break when a certain exception is thrown (caught or uncaught) and to only break when another exception is thrown (but only when uncaught). So I want to specify the caught and uncaught behaviour separately for each exception type. But it seems that how this is implemented the caught and uncaught setting cannot be specified separately for each exception type. Or am I missing something?

NickJAllen avatar Jun 12 '23 16:06 NickJAllen

Through this issue, I just discovered that it's possible to break on certain types of exceptions. It would be great though, to be able to set that through the breakpoints menu in the bottom left corner where all currently active breakpoints are listed.

For me, this setting is rather something that I would activate (and deactivate) ad-hoc for the specific thing I am debugging and not something that I would have permanently configured in some config file...

FieteO avatar Jun 26 '24 07:06 FieteO