From 1499def4a3e4ed17c4752b9bdeb6099522463a97 Mon Sep 17 00:00:00 2001 From: chris Date: Thu, 7 Dec 2023 20:27:25 +0100 Subject: [PATCH] Catch UnknownHostExceptions in legacy ping passthrough pings (#4331) * Catch unknownhostexception to avoid network errors when using legacy ping passthrough * Catch UnknownHostException separately, log a warning but no stacktrace --- .../org/geysermc/geyser/ping/GeyserLegacyPingPassthrough.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/core/src/main/java/org/geysermc/geyser/ping/GeyserLegacyPingPassthrough.java b/core/src/main/java/org/geysermc/geyser/ping/GeyserLegacyPingPassthrough.java index 64ad2c445..6bbca11ca 100644 --- a/core/src/main/java/org/geysermc/geyser/ping/GeyserLegacyPingPassthrough.java +++ b/core/src/main/java/org/geysermc/geyser/ping/GeyserLegacyPingPassthrough.java @@ -139,6 +139,9 @@ public class GeyserLegacyPingPassthrough implements IGeyserPingPassthrough, Runn this.geyser.getLogger().debug("Connection timeout for ping passthrough."); } catch (JsonParseException | JsonMappingException ex) { this.geyser.getLogger().error("Failed to parse json when pinging server!", ex); + } catch (UnknownHostException ex) { + // Don't reset pingInfo, as we want to keep the last known value + this.geyser.getLogger().warning("Unable to resolve remote host! Is the remote server down or invalid?"); } catch (IOException e) { this.geyser.getLogger().error("IO error while trying to use legacy ping passthrough", e); }