diff --git a/desktop/src/com/miloshpetrov/sol2/desktop/SolDesktop.java b/desktop/src/com/miloshpetrov/sol2/desktop/SolDesktop.java index 8b6ec311f..c0913f753 100644 --- a/desktop/src/com/miloshpetrov/sol2/desktop/SolDesktop.java +++ b/desktop/src/com/miloshpetrov/sol2/desktop/SolDesktop.java @@ -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; @@ -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); }