improved error handling

main
Jonah Bauer 3 years ago
parent 7b8c7249ea
commit cdad431128

@ -1,5 +1,6 @@
package eu.jonahbauer.wizard.client.libgdx; package eu.jonahbauer.wizard.client.libgdx;
import eu.jonahbauer.wizard.client.libgdx.screens.ErrorScreen;
import eu.jonahbauer.wizard.client.libgdx.state.ClientState; import eu.jonahbauer.wizard.client.libgdx.state.ClientState;
import eu.jonahbauer.wizard.client.libgdx.state.Menu; import eu.jonahbauer.wizard.client.libgdx.state.Menu;
import eu.jonahbauer.wizard.common.machine.TimeoutContext; import eu.jonahbauer.wizard.common.machine.TimeoutContext;
@ -33,7 +34,10 @@ public class Client extends TimeoutContext<ClientState, Client> {
@Override @Override
protected void handleError(Throwable t) { protected void handleError(Throwable t) {
// TODO better error handling // TODO better error handling
log.error("", t); log.error("An error occurred.", t);
game.setScreen(new ErrorScreen(game, t.getMessage()));
error = true;
var menu = new Menu(); var menu = new Menu();
forceTransition(menu); forceTransition(menu);

Loading…
Cancel
Save