Abacn commented on code in PR #37342:
URL: https://github.com/apache/beam/pull/37342#discussion_r3754427522
##########
sdks/java/io/rrio/src/main/java/org/apache/beam/io/requestresponse/Call.java:
##########
@@ -596,13 +613,10 @@ private void executeAsync(Callable<Void> callable) throws
UserCodeExecutionExcep
private static <T> void parseAndThrow(Future<T> future, ExecutionException e)
throws UserCodeExecutionException {
future.cancel(true);
- if (e.getCause() == null) {
- throw new UserCodeExecutionException(e);
- }
- Throwable cause = checkStateNotNull(e.getCause());
- if (cause instanceof UserCodeQuotaException) {
- throw new UserCodeQuotaException(cause);
+ Throwable cause = e.getCause();
+ if (cause instanceof UserCodeExecutionException) {
+ throw (UserCodeExecutionException) cause;
}
- throw new UserCodeExecutionException(cause);
+ throw new UserCodeExecutionException(cause == null ? e : cause);
Review Comment:
What's the intention of unwrap the exception if cause is present?
I wonder if there is scenario that user code has a `try { .... } catch (e) {
... throw new SomeException(e)}` clause, wrapping it will make part of the
stacktrace get lost.
--
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]