From cdad431128bff7b8ebd1a6c5565c3eeac315aa5b Mon Sep 17 00:00:00 2001 From: Jonah Bauer Date: Mon, 17 Jan 2022 00:41:27 +0100 Subject: [PATCH] improved error handling --- .../java/eu/jonahbauer/wizard/client/libgdx/Client.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/wizard-client/wizard-client-libgdx/core/src/main/java/eu/jonahbauer/wizard/client/libgdx/Client.java b/wizard-client/wizard-client-libgdx/core/src/main/java/eu/jonahbauer/wizard/client/libgdx/Client.java index e58479c..dc64b1e 100644 --- a/wizard-client/wizard-client-libgdx/core/src/main/java/eu/jonahbauer/wizard/client/libgdx/Client.java +++ b/wizard-client/wizard-client-libgdx/core/src/main/java/eu/jonahbauer/wizard/client/libgdx/Client.java @@ -1,5 +1,6 @@ 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.Menu; import eu.jonahbauer.wizard.common.machine.TimeoutContext; @@ -33,7 +34,10 @@ public class Client extends TimeoutContext { @Override protected void handleError(Throwable t) { // 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(); forceTransition(menu);