Visitar URL original
evaluate: Error result is truncated · Issue #343 · microsoft/java-debug · GitHub
The Wayback Machine - https://web.archive.org/web/20201202182634/https://github.com/microsoft/java-debug/issues/343
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

evaluate: Error result is truncated #343

Open
dradtke opened this issue Jul 22, 2020 · 2 comments
Open

evaluate: Error result is truncated #343

dradtke opened this issue Jul 22, 2020 · 2 comments

Comments

@dradtke
Copy link

@dradtke dradtke commented Jul 22, 2020 •

When an evaluate request fails due to an error in the code being evaluated, the language server reports an unhelpful truncated message:

{
  "id": 1010,
  "format": "Cannot evaluate because of org.eclipse.debug.core.DebugException: com.sun.jdi.InvocationException occurred invoking method.."
}

Sometimes this is long enough to be useful, but for errors with longer stack traces, it's often not clear what the error actually was. Is there any way to always get the full error message?

@testforstephen
Copy link
Contributor

@testforstephen testforstephen commented Jul 27, 2020

Can you share the evaluation snippet and it's context? Try to understand how to improve the error message.

@dradtke
Copy link
Author

@dradtke dradtke commented Aug 21, 2020

To reproduce it, I can put a breakpoint on this line, run the program in the debugger, and attempt to evaluate something like this:

spark.sql("select * from nonexistent_table");

And the response from the debug adapter looks like this:

{
  "seq": 53,
  "request_seq": 8,
  "message": "Cannot evaluate because of org.eclipse.debug.core.DebugException: com.sun.jdi.InvocationException: Exception occurred in target VM occurred invoking method..",
  "type": "response",
  "success": false,
  "body": {
    "error": {
      "id": 1010,
      "format": "Cannot evaluate because of org.eclipse.debug.core.DebugException: com.sun.jdi.InvocationException: Exception occurred in target VM occurred invoking method.."
    }
  },
  "command": "evaluate"
}

If I encounter this error outside of the debug adapter, such as during normal execution, I get this error which is more in line with what I would expect to see:

Exception in thread "main" org.apache.spark.sql.AnalysisException: Table or view not found: nonexistent_table; line 1 pos 14;
'Project [*]
+- 'UnresolvedRelation [nonexistent_table]

        at org.apache.spark.sql.catalyst.analysis.package$AnalysisErrorAt.failAnalysis(package.scala:42)
        [...]
        at Main.main(Main.java:6)
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.

None yet
2 participants
You can’t perform that action at this time.