diff --git a/plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/IcebergMetadata.java b/plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/IcebergMetadata.java index 82e7195acaa85..5841143ad854d 100644 --- a/plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/IcebergMetadata.java +++ b/plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/IcebergMetadata.java @@ -163,6 +163,8 @@ import org.apache.iceberg.UpdateSchema; import org.apache.iceberg.UpdateStatistics; import org.apache.iceberg.exceptions.AlreadyExistsException; +import org.apache.iceberg.exceptions.CommitFailedException; +import org.apache.iceberg.exceptions.CommitStateUnknownException; import org.apache.iceberg.exceptions.ValidationException; import org.apache.iceberg.expressions.Expressions; import org.apache.iceberg.expressions.Term; @@ -1810,7 +1812,7 @@ private static void commitUpdateAndTransaction(SnapshotUpdate update, Connect commit(update, session); commitTransaction(transaction, operation); } - catch (UncheckedIOException | ValidationException e) { + catch (UncheckedIOException | ValidationException | CommitFailedException | CommitStateUnknownException e) { throw new TrinoException(ICEBERG_COMMIT_ERROR, format("Failed to commit during %s: %s", operation, firstNonNull(e.getMessage(), e)), e); } } @@ -1820,7 +1822,7 @@ private static void commitTransaction(Transaction transaction, String operation) try { transaction.commitTransaction(); } - catch (ValidationException e) { + catch (ValidationException | CommitFailedException | CommitStateUnknownException e) { throw new TrinoException(ICEBERG_COMMIT_ERROR, format("Failed to commit the transaction during %s: %s", operation, firstNonNull(e.getMessage(), e)), e); } }