From 65ede11ab54fbf9fbdfffeb601dbdd054fc21002 Mon Sep 17 00:00:00 2001 From: EpicKnarvik97 Date: Mon, 27 Sep 2021 23:19:52 +0200 Subject: [PATCH] Improves behavior when an error occurs during backup --- .../minecraftserverlauncher/utility/BackupUtil.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main/java/net/knarcraft/minecraftserverlauncher/utility/BackupUtil.java b/src/main/java/net/knarcraft/minecraftserverlauncher/utility/BackupUtil.java index 47034a6..1a752af 100644 --- a/src/main/java/net/knarcraft/minecraftserverlauncher/utility/BackupUtil.java +++ b/src/main/java/net/knarcraft/minecraftserverlauncher/utility/BackupUtil.java @@ -15,6 +15,7 @@ import java.io.OutputStream; import java.nio.file.Files; import java.nio.file.Path; import java.util.ArrayList; +import java.util.Arrays; import java.util.List; import java.util.stream.Stream; @@ -183,8 +184,9 @@ public class BackupUtil { try { alreadyCopied += backupFolder(srcFolder, destinationFolder, backupFileSize, alreadyCopied); } catch (IOException e) { - e.printStackTrace(); - gui.setStatus("Backup caused an error"); + gui.showError("Backup caused an error: " + e.getMessage()); + gui.logError(Arrays.toString(e.getStackTrace())); + BackupGUI.destroy(); backupRunning = false; } return alreadyCopied;