From 1fdb7d8e0dbdde9f39d61bd53c4c18f026c7630d Mon Sep 17 00:00:00 2001 From: Lixfel Date: Wed, 17 Jan 2024 12:13:33 +0100 Subject: [PATCH] Add logfile to exception --- .../src/de/steamwar/core/CheckpointUtils.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/SpigotCore_Main/src/de/steamwar/core/CheckpointUtils.java b/SpigotCore_Main/src/de/steamwar/core/CheckpointUtils.java index bb7ba3d..13feea8 100644 --- a/SpigotCore_Main/src/de/steamwar/core/CheckpointUtils.java +++ b/SpigotCore_Main/src/de/steamwar/core/CheckpointUtils.java @@ -30,9 +30,7 @@ import org.eclipse.openj9.criu.CRIUSupport; import org.eclipse.openj9.criu.JVMCRIUException; import sun.misc.Signal; -import java.io.DataInputStream; -import java.io.File; -import java.io.IOException; +import java.io.*; import java.net.InetAddress; import java.nio.file.FileSystems; import java.nio.file.Files; @@ -109,6 +107,11 @@ public class CheckpointUtils { criu.checkpointJVM(); } catch (JVMCRIUException e) { Bukkit.shutdown(); + + Path logfile = path.resolve("criu.log"); + if(logfile.toFile().exists()) + throw new IllegalStateException("Could not create checkpoint, criu log:\n" + new String(Files.readAllBytes(logfile)), e); + throw e; }