From f5e78371be4203684c827c7fa91091d17d39b04e Mon Sep 17 00:00:00 2001 From: Camotoy <20743703+DoctorMacc@users.noreply.github.com> Date: Tue, 28 Jul 2020 18:47:08 -0400 Subject: [PATCH] Hide stack trace if an SRV record is unable to be found. (#1046) --- .../main/java/org/geysermc/connector/GeyserConnector.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/connector/src/main/java/org/geysermc/connector/GeyserConnector.java b/connector/src/main/java/org/geysermc/connector/GeyserConnector.java index 669458385..ee687dbbd 100644 --- a/connector/src/main/java/org/geysermc/connector/GeyserConnector.java +++ b/connector/src/main/java/org/geysermc/connector/GeyserConnector.java @@ -58,7 +58,6 @@ import org.geysermc.connector.utils.DockerCheck; import org.geysermc.connector.utils.LanguageUtils; import org.geysermc.connector.utils.LocaleUtils; -import javax.naming.NamingException; import javax.naming.directory.Attribute; import javax.naming.directory.InitialDirContext; import java.net.InetSocketAddress; @@ -156,8 +155,10 @@ public class GeyserConnector { config.getRemote().setPort(remotePort = Integer.parseInt(record[2])); logger.debug("Found SRV record \"" + remoteAddress + ":" + remotePort + "\""); } - } catch (NamingException ex) { - ex.printStackTrace(); + } catch (Exception ex) { + logger.debug("Exception while trying to find an SRV record for the remote host."); + if (config.isDebugMode()) + ex.printStackTrace(); // Otherwise we can get a stack trace for any domain that doesn't have an SRV record } }