dimas-b commented on code in PR #5259:
URL: https://github.com/apache/iceberg/pull/5259#discussion_r919294729


##########
api/src/main/java/org/apache/iceberg/util/ExceptionUtil.java:
##########
@@ -113,15 +114,20 @@ public static <R, E1 extends Exception, E2 extends 
Exception, E3 extends Excepti
         try {
           finallyBlock.run();
         } catch (Exception e) {
-          LOG.warn("Suppressing failure in finally block", e);
           if (failure != null) {
+            LOG.warn("Suppressing failure in finally block", e);
             failure.addSuppressed(e);
+            tryThrowAs(failure, e1Class);

Review Comment:
   This is probably not necessary and actually goes against the ErrorProne 
guideline of not throwing from `finally`.
   
   The only way `failure` can be non-null here is if it was thrown from the 
main `try` block, in which case the generated bytecode will ensure it is 
re-thrown when `finally` completes.



-- 
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]

Reply via email to