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

[Feature] Exception filter for handled/unhandled exception

Open andxu opened this issue 7 years ago • 3 comments
trafficstars

andxu avatar Apr 27 '18 01:04 andxu

We need have a look at the user experience for supporting this. There are already some discussions about this in VS Code. See https://github.com/Microsoft/vscode/issues/11552

testforstephen avatar May 23 '18 09:05 testforstephen

https://github.com/Microsoft/vscode/issues/58162

andxu avatar Sep 07 '18 07:09 andxu

Will impl like this(available in 0.14.0) 0e1622fc-19ec-11e7-8919-d1bc1181b517 1

andxu avatar Sep 14 '18 01:09 andxu

What's the status of this? Was it merged?

worksofliam avatar Mar 09 '23 15:03 worksofliam

Not fully supported yet.

so far we have exposed a setting java.debug.settings.exceptionBreakpoint.skipClasses to skip the specified classes when breaking on exception. Maybe we should add a new setting java.debug.settings.exceptionBreakpoint.allowClasses as well to specify what exception breakpoints you can enable.

testforstephen avatar Mar 10 '23 02:03 testforstephen

Exactly you need to specify the set of exception on which you want to break. This is how both eclipse and intellij are working. This is very basic stuff, I'm quite surprised it isn't there yet.

abique avatar Mar 24 '23 10:03 abique

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

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.

Based on current UI limitation, you can set caught/uncaught flag for all target exception types, but not individually for each exception type.

testforstephen avatar Jun 13 '23 02:06 testforstephen

Do you think this limitation will be lifted some time?

NickJAllen avatar Jun 13 '23 06:06 NickJAllen

Has this been closed for good? I used individual exception breakpoints a lot in Eclipse, would really make use of it in VS Code now.

heruan avatar Feb 17 '24 15:02 heruan