Skip to content

Show target VM exceptions as result in evaluate requests - #428

Merged
Jinbo Wang (testforstephen) merged 1 commit into
microsoft:mainfrom
mfussenegger:vm-exceptions
Jul 22, 2022
Merged

Jinbo Wang (testforstephen) merged 1 commit into
microsoft:mainfrom
mfussenegger:vm-exceptions

Conversation

@mfussenegger

@mfussenegger Mathias Fußenegger (mfussenegger) commented Jul 20, 2022 •

Copy link
Copy Markdown
Contributor

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
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Mathias Fußenegger (@mfussenegger) It's a nice improvement. Thanks for contribution.

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