Graphics API init will now catch exceptions

This commit is contained in:
JeremyStar™ 2024-07-11 16:16:30 +02:00
parent 005ebfbfae
commit 2b83a1885e
Signed by: JeremyStarTM
GPG key ID: E366BAEF67E4704D

View file

@ -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());
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;
}
}