vscode-java-debug
vscode-java-debug copied to clipboard
Allow to break on caught/uncaught exceptions by name or package namespace
"Ability to set exception breakpoint by name would be great. Caught / uncaught exception is not enough."
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"
This has been supported in 0.50.0 version.
Here is how to enable exception breakpoint on the specified exception type:
- Configure the exception types in the setting
java.debug.settings.exceptionBreakpoint.exceptionTypes
.
"java.debug.settings.exceptionBreakpoint.exceptionTypes": [
"java.lang.NullPointerException" // fully qualified class name
]
- Go to Breakpoint view, toggle the CaughtException or UncaughtException.
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?
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...