question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[FEATURE REQUEST]: Expose JVM exceptions

See original GitHub issue

Currently an exception is only logged and then translated per the below.

[2020-04-03T00:31:33.1953860Z] [0ecc54d4f7e9] [Error] [JvmBridge] JVM method execution failed: Nonstatic method sql failed for class 435 when called with 1 arguments ([Index=1, Type=String, Value=select
 NOTACOLUMN from tmp], )
[2020-04-03T00:31:33.1955104Z] [0ecc54d4f7e9] [Error] [JvmBridge] org.apache.spark.sql.AnalysisException: cannot resolve '`NOTACOLUMN`' given input columns: [tmp.Parameter]; line 1 pos 7;
'Project ['NOTACOLUMN]
+- SubqueryAlias `tmp`
   +- Relation[Parameter#20315] parquet<...SNIP...>

Is it possible maybe throw an AggregateException with both exceptions or pass an InnerException containing the full original exception?

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:1
  • Comments:12 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
thrixtoncommented, Jun 12, 2020

Some more thoughts. #541 is quite a basic implementation and will expose the relevant information, but not in the nicest format. @imback82, would it be possible or advisable to expose more information from the JVM? e.g.

Field Example
ExceptionType org.apache.spark.sql.catalyst.parser.ParseException
Message mismatched input ‘fu’ expecting {‘(’, <…SNIP…>'}(line 1, pos 0) == SQL == fu
StackTrace org.apache.spark.sql.catalyst.par<…SNIP…>

Even better would be transposing most / all relevant exceptions from the JVM to c# exceptions.
To give some context, at some point I will have to parse the exception message so I can draw out specific error details, e.g. if the exception is an SQL exception (it is above), where it occurred (line 1, pos 0).
This task would be a lot easier with more exception details.

This would involve changes on the scala side though, I believe.

Thoughts?

1reaction
imback82commented, Apr 3, 2020

Thanks @thrixton. Can you make the change and show how the new log message will look?

Read more comments on GitHub >

github_iconTop Results From Across the Web

possible to expose sensitive information via Java ...
The most common way of exposing sensitive information is to give the user (client) of the program a stack trace.
Read more >
Clean Code and the Art of Exception Handling
So, exceptions require special treatment, and an unhandled exception may cause unexpected behavior. The results are often spectacular.
Read more >
Swallowed Exceptions: The Silent Killer of Java Applications
In this post, our goal is to see what it takes to avoid the risks of mishandled errors.
Read more >
Exception Handling in Java
An exception is an error event that can happen during the execution of a program and disrupts its normal flow. Java provides a...
Read more >
Java Error Tracking and Performance Monitoring
Expose the important events that led to each Java exception: debug logs, network requests, database queries, past errors.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found