cloud-fan opened a new pull request, #54005: URL: https://github.com/apache/spark/pull/54005
### What changes were proposed in this pull request? This PR refactors how `doTryWithCallerStacktrace` and `getTryWithCallerStacktrace` handle stacktrace stitching. Instead of adding an `OriginalTryStackTraceException` as a suppressed exception on the original exception, we now wrap the original exception inside `OriginalTryStackTraceException`. Key changes: - `OriginalTryStackTraceException` now wraps the original exception (as its cause) and stores the pre-computed "below" stacktrace portion - `doTryWithCallerStacktrace` returns `Failure(wrapper)` instead of modifying the original exception's suppressed list - `getTryWithCallerStacktrace` unwraps the original exception, stitches the stacktrace, and throws the original (not the wrapper) ### Why are the changes needed? Benefits: - **Cleaner exception output** - no suppressed exceptions visible to users - **Simpler code** - no need to track first access or manage suppressed exception lifecycle - **Original exception type preserved** - when thrown, users see their original exception type ### Does this PR introduce _any_ user-facing change? Yes, exceptions thrown from `LazyTry.get` will no longer have a suppressed `OriginalTryStackTraceException`. The stacktrace stitching behavior remains the same. ### How was this patch tested? Existing unit tests in `UtilsSuite` and `LazyTrySuite` updated and passing. ### Was this patch authored or co-authored using generative AI tooling? Yes. -- 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]
