Skip to content

Commit

Permalink
Display a message box with the error as to why the game didn't start.
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonC4 committed Aug 6, 2015
1 parent cd0567b commit f39e9f7
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions desktop/src/com/miloshpetrov/sol2/desktop/SolDesktop.java
Expand Up @@ -9,6 +9,7 @@
import com.miloshpetrov.sol2.SolFileReader;
import com.miloshpetrov.sol2.game.DebugOptions;
import com.miloshpetrov.sol2.soundtest.SoundTestListener;
import org.lwjgl.Sys;

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

Thread.setDefaultUncaughtExceptionHandler(new Thread.UncaughtExceptionHandler() {
@Override
public void uncaughtException (Thread thread, final Throwable ex) {
System.err.println("Critical Failure" + ex.getLocalizedMessage());
Sys.alert("Critical Failure", ex.getLocalizedMessage());
}
});

new LwjglApplication(new SolApplication(), c);
}

Expand Down

0 comments on commit f39e9f7

Please sign in to comment.