marko-sisovic-db opened a new pull request, #60454: URL: https://github.com/apache/spark/pull/60454
### What changes were proposed in this pull request? Preserve structured Spark Connect error details for JVM linkage errors, including `NoClassDefFoundError`, `ExceptionInInitializerError`, and `NoSuchMethodError`. Also serialize null exception messages as empty strings when fetching error details. ### Why are the changes needed? Scala's `NonFatal` excludes `LinkageError`, so these failures currently fall back to a generic `UNKNOWN` gRPC response without an error ID. Clients cannot fetch the JVM stack trace or cause chain. `ExceptionInInitializerError(cause)` also has a null message, which the protobuf message setter rejects. ### Does this PR introduce _any_ user-facing change? Yes. Already-failing Spark Connect requests still fail, but JVM linkage errors return `INTERNAL` with structured exception metadata instead of `UNKNOWN`. With error enrichment enabled, clients can fetch the JVM stack and cause chain through the existing error-details API. Other fatal errors retain the existing fallback. ### How was this patch tested? Added three regression cases in `FetchErrorDetailsHandlerSuite`. Each passes a linkage error through `handleError`, fetches details using the emitted error ID, and verifies exception types, messages, stack frames, and cause links. The initializer-error case covers a null exception message. `git diff --check` and source line-length checks pass. Scala tests have not been run locally. Draft pending creation of a SPARK JIRA ticket. ### Was this patch authored or co-authored using generative AI tooling? Generated-by: OpenAI Codex -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
