From 33d50cb6689188457445322d820c726990cb6f15 Mon Sep 17 00:00:00 2001 From: onebeastchris Date: Sun, 7 May 2023 09:07:27 +0200 Subject: [PATCH] Change the API not found error message #3670) --- core/src/main/java/org/geysermc/geyser/Constants.java | 3 +-- .../org/geysermc/geyser/skin/FloodgateSkinUploader.java | 7 ++++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/core/src/main/java/org/geysermc/geyser/Constants.java b/core/src/main/java/org/geysermc/geyser/Constants.java index e8544f000..9ae2109e2 100644 --- a/core/src/main/java/org/geysermc/geyser/Constants.java +++ b/core/src/main/java/org/geysermc/geyser/Constants.java @@ -46,9 +46,8 @@ public final class Constants { try { wsUri = new URI("wss://api.geysermc.org/ws"); } catch (URISyntaxException e) { - GeyserImpl.getInstance().getLogger().error("Unable to resolve api.geysermc.org! Check your internet connection."); e.printStackTrace(); } GLOBAL_API_WS_URI = wsUri; } -} +} \ No newline at end of file diff --git a/core/src/main/java/org/geysermc/geyser/skin/FloodgateSkinUploader.java b/core/src/main/java/org/geysermc/geyser/skin/FloodgateSkinUploader.java index 6655c1a92..39de6c32a 100644 --- a/core/src/main/java/org/geysermc/geyser/skin/FloodgateSkinUploader.java +++ b/core/src/main/java/org/geysermc/geyser/skin/FloodgateSkinUploader.java @@ -44,6 +44,7 @@ import org.java_websocket.handshake.ServerHandshake; import javax.net.ssl.SSLException; import java.net.ConnectException; +import java.net.UnknownHostException; import java.nio.charset.StandardCharsets; import java.util.ArrayList; import java.util.Iterator; @@ -175,6 +176,10 @@ public final class FloodgateSkinUploader { @Override public void onError(Exception ex) { + if (ex instanceof UnknownHostException) { + logger.error("Unable to resolve the skin api! This can be caused by your connection or the skin api being unreachable. " + ex.getMessage()); + return; + } if (ex instanceof ConnectException || ex instanceof SSLException) { if (logger.isDebug()) { logger.error("[debug] Got an error", ex); @@ -237,4 +242,4 @@ public final class FloodgateSkinUploader { client.close(); } } -} +} \ No newline at end of file