From 6ac35d3d62744dd075a7879a41bd8764f48823c6 Mon Sep 17 00:00:00 2001 From: filoghost Date: Mon, 13 Dec 2021 23:40:53 +0100 Subject: [PATCH] Fix spam in console when a remote server is down --- .../plugin/bridge/bungeecord/BungeeServerTracker.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/plugin/src/main/java/me/filoghost/holographicdisplays/plugin/bridge/bungeecord/BungeeServerTracker.java b/plugin/src/main/java/me/filoghost/holographicdisplays/plugin/bridge/bungeecord/BungeeServerTracker.java index c7097141..45dee998 100644 --- a/plugin/src/main/java/me/filoghost/holographicdisplays/plugin/bridge/bungeecord/BungeeServerTracker.java +++ b/plugin/src/main/java/me/filoghost/holographicdisplays/plugin/bridge/bungeecord/BungeeServerTracker.java @@ -17,6 +17,7 @@ import org.bukkit.plugin.Plugin; import org.jetbrains.annotations.NotNull; import java.io.IOException; +import java.net.ConnectException; import java.net.SocketTimeoutException; import java.net.UnknownHostException; import java.util.concurrent.ConcurrentHashMap; @@ -107,8 +108,9 @@ public class BungeeServerTracker { return ServerInfo.online(0, 0, "Invalid ping response (" + e.getMessage() + ")"); } catch (IOException e) { - if (e instanceof SocketTimeoutException) { - // Common error, do not log + if (e instanceof SocketTimeoutException || e instanceof ConnectException) { + // Common error, only log when debugging + DebugLogger.warning("Couldn't fetch data from " + serverAddress + ".", e); } else if (e instanceof UnknownHostException) { Log.warning("Couldn't fetch data from " + serverAddress + ": unknown host address."); } else {