Skip to content

Commit

Permalink
Catch UncheckedIOException during PCES file copy. (#10083)
Browse files Browse the repository at this point in the history
Signed-off-by: Cody Littley <cody@swirldslabs.com>
  • Loading branch information
cody-littley committed Nov 22, 2023
1 parent f01ed89 commit edc657a
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import com.swirlds.common.system.NodeId;
import edu.umd.cs.findbugs.annotations.NonNull;
import java.io.IOException;
import java.io.UncheckedIOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.ArrayList;
Expand Down Expand Up @@ -92,7 +93,9 @@ public static void copyPreconsensusEventStreamFilesRetryOnFailure(
platformContext, selfId, temporaryDirectory, minimumGenerationNonAncient));

return;
} catch (final IOException e) {
} catch (final IOException | UncheckedIOException e) {
// Note: Files.walk() sometimes throws an UncheckedIOException (?!!), so we have to catch both.

if (triesRemaining > 0) {
logger.warn(STATE_TO_DISK.getMarker(), "Unable to copy PCES files. Retrying.");
} else {
Expand Down

0 comments on commit edc657a

Please sign in to comment.