From 32fb5092c3943e5c7f64e3ee816ea5825515760c Mon Sep 17 00:00:00 2001 From: Bixilon Date: Sat, 5 Sep 2020 22:52:02 +0200 Subject: [PATCH] handle TextParseException correctly, show full exception in Server info --- .../java/de/bixilon/minosoft/gui/main/ServerListCell.java | 2 +- .../java/de/bixilon/minosoft/protocol/network/Connection.java | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main/java/de/bixilon/minosoft/gui/main/ServerListCell.java b/src/main/java/de/bixilon/minosoft/gui/main/ServerListCell.java index 0eae21a6f..333bccbcd 100644 --- a/src/main/java/de/bixilon/minosoft/gui/main/ServerListCell.java +++ b/src/main/java/de/bixilon/minosoft/gui/main/ServerListCell.java @@ -332,7 +332,7 @@ public class ServerListCell extends ListCell implements Initializable { if (server.getLastPing() != null) { if (server.getLastPing().getLastConnectionException() != null) { - Label lastConnectionExceptionLabel = new Label(server.getLastPing().getLastConnectionException().getLocalizedMessage()); + Label lastConnectionExceptionLabel = new Label(server.getLastPing().getLastConnectionException().toString()); lastConnectionExceptionLabel.setStyle("-fx-text-fill: red"); grid.add(new Label("Last connection exception:"), 0, ++column); grid.add(lastConnectionExceptionLabel, 1, column); diff --git a/src/main/java/de/bixilon/minosoft/protocol/network/Connection.java b/src/main/java/de/bixilon/minosoft/protocol/network/Connection.java index da391a7fb..155103673 100644 --- a/src/main/java/de/bixilon/minosoft/protocol/network/Connection.java +++ b/src/main/java/de/bixilon/minosoft/protocol/network/Connection.java @@ -86,8 +86,10 @@ public class Connection { try { addresses = DNSUtil.getServerAddresses(hostname); } catch (TextParseException e) { + setConnectionState(ConnectionStates.FAILED_NO_RETRY); + network.lastException = e; e.printStackTrace(); - throw new RuntimeException(e); + return; } } address = addresses.getFirst();