Skip to content

Commit f39e9f7

Browse files
committed
Display a message box with the error as to why the game didn't start.
1 parent cd0567b commit f39e9f7

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

desktop/src/com/miloshpetrov/sol2/desktop/SolDesktop.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
import com.miloshpetrov.sol2.SolFileReader;
1010
import com.miloshpetrov.sol2.game.DebugOptions;
1111
import com.miloshpetrov.sol2.soundtest.SoundTestListener;
12+
import org.lwjgl.Sys;
1213

1314
import java.io.BufferedReader;
1415
import java.io.FileReader;
@@ -54,6 +55,14 @@ public static void main(String[] argv) {
5455
c.addIcon(DebugOptions.DEV_ROOT_PATH + "res/icon.png", Files.FileType.Absolute);
5556
}
5657

58+
Thread.setDefaultUncaughtExceptionHandler(new Thread.UncaughtExceptionHandler() {
59+
@Override
60+
public void uncaughtException (Thread thread, final Throwable ex) {
61+
System.err.println("Critical Failure" + ex.getLocalizedMessage());
62+
Sys.alert("Critical Failure", ex.getLocalizedMessage());
63+
}
64+
});
65+
5766
new LwjglApplication(new SolApplication(), c);
5867
}
5968

0 commit comments

Comments
 (0)