also catch startup exceptions

This commit is contained in:
yugecin 2017-01-15 00:21:52 +01:00
parent 4f10577321
commit 88676f2c36

View File

@ -23,7 +23,6 @@ import itdelatrisu.opsu.Utils;
import itdelatrisu.opsu.db.DBController;
import itdelatrisu.opsu.downloads.DownloadList;
import itdelatrisu.opsu.downloads.Updater;
import org.lwjgl.LWJGLException;
import org.newdawn.slick.util.Log;
import yugecin.opsudance.core.DisplayContainer;
import yugecin.opsudance.errorhandling.ErrorHandler;
@ -52,6 +51,7 @@ public class OpsuDance {
}
public void start(String[] args) {
try {
sout("initialized");
checkRunningDirectory();
@ -64,6 +64,9 @@ public class OpsuDance {
sout("database & updater initialized");
container.demux.switchStateNow(EmptyState.class);
} catch (Exception e) {
errorAndExit("startup failure", e);
}
while (rungame());
@ -75,9 +78,8 @@ public class OpsuDance {
private boolean rungame() {
try {
container.setup();
} catch (LWJGLException e) {
ErrorHandler.error("could not initialize GL", e).preventContinue().show();
System.exit(1);
} catch (Exception e) {
errorAndExit("could not initialize GL", e);
}
Exception caughtException = null;
try {