Skip to content

Commit 031569d

Browse files
committed
Retain rollback exception as suppressed
No need to swallow it. Keep for visibility.
1 parent 5c754e9 commit 031569d

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

plugin/trino-hive/src/main/java/io/trino/plugin/hive/parquet/ParquetFileWriter.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -147,13 +147,14 @@ public Closeable commit()
147147
parquetWriter.close();
148148
}
149149
catch (IOException | UncheckedIOException e) {
150+
TrinoException trinoException = new TrinoException(HIVE_WRITER_CLOSE_ERROR, "Error committing write to Parquet file", e);
150151
try {
151152
rollbackAction.close();
152153
}
153-
catch (Exception _) {
154-
// ignore
154+
catch (Exception rollbackException) {
155+
trinoException.addSuppressed(rollbackException);
155156
}
156-
throw new TrinoException(HIVE_WRITER_CLOSE_ERROR, "Error committing write to Parquet file", e);
157+
throw trinoException;
157158
}
158159

159160
if (validationInputFactory.isPresent()) {

0 commit comments

Comments
 (0)