From 2b83a1885e7d6e7367ee4bac01e5c0467d4c9220 Mon Sep 17 00:00:00 2001 From: JeremyStarTM Date: Thu, 11 Jul 2024 16:16:30 +0200 Subject: [PATCH] Graphics API init will now catch exceptions --- .../sosengine/graphics/GraphicsSubsystem.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/graphics/src/main/java/de/staropensource/sosengine/graphics/GraphicsSubsystem.java b/graphics/src/main/java/de/staropensource/sosengine/graphics/GraphicsSubsystem.java index 0328f8e..6c2aa90 100644 --- a/graphics/src/main/java/de/staropensource/sosengine/graphics/GraphicsSubsystem.java +++ b/graphics/src/main/java/de/staropensource/sosengine/graphics/GraphicsSubsystem.java @@ -211,11 +211,16 @@ public final class GraphicsSubsystem implements SubsystemMainClass { logger.verb("Choosing a compatible Graphics API: Chose Graphics API " + compatibleApis.getLast()); api = registeredApis.get(compatibleApis.getLast()); - api.initializeApi(); + try { + api.initializeApi(); + } catch (Throwable throwable) { + logger.crash("Graphics API " + api.getApiName() + " failed to initialize", throwable, true); + throw throwable; + } return true; } else { - logger.error("Choosing a compatible Graphics API: No compatible Graphics API found"); + logger.error("Choosing a compatible Graphics API: No compatible Graphics API was found"); return false; } }