★ wanayoo — archive 1999 https://github.com/microsoft/vscode-java-debug/issues/756Nouvelle recherche | Portail wanayoo
Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Break on exception in Java for “just my code” #756

Closed
spottedmahn opened this issue Feb 6, 2020 · 6 comments
Closed

Break on exception in Java for “just my code” #756

spottedmahn opened this issue Feb 6, 2020 · 6 comments
Assignees
Milestone

Comments

@spottedmahn
Copy link

@spottedmahn spottedmahn commented Feb 6, 2020

Environment
  • Operating System: Win10
  • JDK version:
  • Visual Studio Code version: 1.41.1
  • Java extension version: 0.55.1
  • Java Debugger extension version: 0.24.0
Question

How can I configure VS Code to only break on an exception in "just my code"? I've messed around w/ the Uncaught Exceptions & Caught Exceptions but they are not scoped to my code.

Additional Notes

We've added support for exception configuration to the debug protocol (microsoft/vscode-debugadapter-node#64). Source

Something like Visual Studio -> Enable or disable Just My Code.

@akaroml akaroml added the question label Feb 7, 2020
@akaroml
Copy link
Member

@akaroml akaroml commented Feb 7, 2020

@spottedmahn Thanks for reaching out.

Unfortunately, the debugger does not support the exact feature you requested. However, it does support something similar. Please check out the stepFilters option, which can be specified in launch configurations to avoid breaking in certain classes.

@akaroml
Copy link
Member

@akaroml akaroml commented Feb 7, 2020

I also see "Just My Code" a nice improvement for the debugger. Let's track it in longer-term @testforstephen

@spottedmahn
Copy link
Author

@spottedmahn spottedmahn commented Feb 17, 2020

Thanks @akaroml for the reply!

Please check out the stepFilters option, which can be specified in launch configurations to avoid breaking in certain classes.

That helped but I'm still left w/ a lot of undesired breaks due to Unknown source and stepFilters can't help w/ that 🤔:

It (stepFilters) cannot help you to ignore the Unknown Source source

@akaroml
Copy link
Member

@akaroml akaroml commented Feb 18, 2020

Thanks @akaroml for the reply!

Please check out the stepFilters option, which can be specified in launch configurations to avoid breaking in certain classes.

That helped but I'm still left w/ a lot of undesired breaks due to Unknown source and stepFilters can't help w/ that 🤔:

It (stepFilters) cannot help you to ignore the Unknown Source source

I agree that Just My Code will improve the experience. But it's not an easy piece and we'll plan it in longer term.

@testforstephen
Copy link
Contributor

@testforstephen testforstephen commented Jul 16, 2020

In the new 0.27.0, when you want to break on exception for "Just My Code", you can add the following settings for that.

    "java.debug.settings.exceptionBreakpoint.skipClasses": [
        "$JDK", // Skip the JDK classes from the default system bootstrap classpath, such as rt.jar, jrt-fs.jar.
        "$Libraries", // Skip the classes from application libraries, such as Maven, Gradle dependencies.
        // "java.myPackage.myClass"
    ],
@spottedmahn
Copy link
Author

@spottedmahn spottedmahn commented Aug 13, 2020

thanks @testforstephen!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

3 participants
You can’t perform that action at this time.