From 19f68383007b6b9d554ff2827455f86f8a95e486 Mon Sep 17 00:00:00 2001 From: JeremyStarTM Date: Mon, 2 Dec 2024 21:34:35 +0100 Subject: [PATCH] Fix engine initialization exception handling --- .../src/main/java/de/staropensource/engine/base/Engine.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/base/src/main/java/de/staropensource/engine/base/Engine.java b/base/src/main/java/de/staropensource/engine/base/Engine.java index 057e18d..bc4d989 100644 --- a/base/src/main/java/de/staropensource/engine/base/Engine.java +++ b/base/src/main/java/de/staropensource/engine/base/Engine.java @@ -289,10 +289,8 @@ public final class Engine extends SubsystemClass { if (instance == null) new Engine(); } catch (RuntimeException exception) { - Logger.error("Engine initialization failed"); - Logger.error(Miscellaneous.throwableHeader(exception.getCause())); - for (String line : Miscellaneous.stacktraceAsString(exception.getCause(), true).split("\n")) - Logger.error(line); + Logger.error("Engine initialization failed\n" + Miscellaneous.stacktraceAsStringRecursive(exception.getCause(), true, true)); + Logger.flush(); throw new RuntimeException("Engine initialization failed", exception.getCause()); }