v0.8.0b: fixed error printouts being eaten if game fails to start
This commit is contained in:
@@ -249,7 +249,16 @@ public class Game implements ApplicationListener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static void reportException( Throwable tr ) {
|
public static void reportException( Throwable tr ) {
|
||||||
if (instance != null) instance.logException(tr);
|
if (instance != null) {
|
||||||
|
instance.logException(tr);
|
||||||
|
} else {
|
||||||
|
//fallback if error happened in initialization
|
||||||
|
StringWriter sw = new StringWriter();
|
||||||
|
PrintWriter pw = new PrintWriter(sw);
|
||||||
|
tr.printStackTrace(pw);
|
||||||
|
pw.flush();
|
||||||
|
System.err.println(sw.toString());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void logException( Throwable tr ){
|
protected void logException( Throwable tr ){
|
||||||
|
|||||||
@@ -79,7 +79,7 @@ public class DesktopLauncher {
|
|||||||
"If you could, please email this error message to the developer (Evan@ShatteredPixel.com):\n\n" +
|
"If you could, please email this error message to the developer (Evan@ShatteredPixel.com):\n\n" +
|
||||||
exceptionMsg,
|
exceptionMsg,
|
||||||
"ok", "error", false );
|
"ok", "error", false );
|
||||||
Gdx.app.exit();
|
if (Gdx.app != null) Gdx.app.exit();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user