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

Show target VM exceptions as result in evaluate requests #428

Merged
merged 1 commit into from
Jul 22, 2022

Conversation

mfussenegger
Copy link
Contributor

@mfussenegger mfussenegger commented Jul 20, 2022

This changes the result of an expression like Long.parseLong("foo")
sent to the evaluate handler from:

org.eclipse.debug.core.DebugException: com.sun.jdi.InvocationException: Exception occurred in target VM occurred invoking method.

to the actual exception:

NumberFormatException@76 "java.lang.NumberFormatException: For input string: "foo""
  backtrace: Object[6]@82
  cause: NumberFormatException@76
  depth: 46
  detailMessage: "For input string: "foo""
  stackTrace: StackTraceElement[0]@84
  suppressedExceptions: Collections$EmptyList@85 size=0

I think this makes the console in vscode and other DAP clients more useful as you get a more meaningful result for expressions that fail

This changes the result of an expression like `Long.parseLong("foo")`
sent to the evaluate handler from:

    org.eclipse.debug.core.DebugException: com.sun.jdi.InvocationException: Exception occurred in target VM occurred invoking method.

to the actual exception:

    NumberFormatException@76 "java.lang.NumberFormatException: For input string: "foo""
      backtrace: Object[6]@82
      cause: NumberFormatException@76
      depth: 46
      detailMessage: "For input string: "foo""
      stackTrace: StackTraceElement[0]@84
      suppressedExceptions: Collections$EmptyList@85 size=0
Copy link
Contributor

@testforstephen testforstephen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mfussenegger It's a nice improvement. Thanks for contribution.

@testforstephen testforstephen merged commit 93963b9 into microsoft:main Jul 22, 2022
@mfussenegger mfussenegger deleted the vm-exceptions branch July 22, 2022 07:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants