handle TextParseException correctly, show full exception in Server info

This commit is contained in:
Bixilon 2020-09-05 22:52:02 +02:00
parent 982af3b5e5
commit 32fb5092c3
No known key found for this signature in database
GPG Key ID: 5CAD791931B09AC4
2 changed files with 4 additions and 2 deletions

View File

@ -332,7 +332,7 @@ public class ServerListCell extends ListCell<Server> implements Initializable {
if (server.getLastPing() != null) { if (server.getLastPing() != null) {
if (server.getLastPing().getLastConnectionException() != 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"); lastConnectionExceptionLabel.setStyle("-fx-text-fill: red");
grid.add(new Label("Last connection exception:"), 0, ++column); grid.add(new Label("Last connection exception:"), 0, ++column);
grid.add(lastConnectionExceptionLabel, 1, column); grid.add(lastConnectionExceptionLabel, 1, column);

View File

@ -86,8 +86,10 @@ public class Connection {
try { try {
addresses = DNSUtil.getServerAddresses(hostname); addresses = DNSUtil.getServerAddresses(hostname);
} catch (TextParseException e) { } catch (TextParseException e) {
setConnectionState(ConnectionStates.FAILED_NO_RETRY);
network.lastException = e;
e.printStackTrace(); e.printStackTrace();
throw new RuntimeException(e); return;
} }
} }
address = addresses.getFirst(); address = addresses.getFirst();