Change the API not found error message #3670)

This commit is contained in:
onebeastchris 2023-05-07 09:07:27 +02:00 committed by GitHub
parent 0d25a3f04d
commit 33d50cb668
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 3 deletions

View File

@ -46,9 +46,8 @@ public final class Constants {
try { try {
wsUri = new URI("wss://api.geysermc.org/ws"); wsUri = new URI("wss://api.geysermc.org/ws");
} catch (URISyntaxException e) { } catch (URISyntaxException e) {
GeyserImpl.getInstance().getLogger().error("Unable to resolve api.geysermc.org! Check your internet connection.");
e.printStackTrace(); e.printStackTrace();
} }
GLOBAL_API_WS_URI = wsUri; GLOBAL_API_WS_URI = wsUri;
} }
} }

View File

@ -44,6 +44,7 @@ import org.java_websocket.handshake.ServerHandshake;
import javax.net.ssl.SSLException; import javax.net.ssl.SSLException;
import java.net.ConnectException; import java.net.ConnectException;
import java.net.UnknownHostException;
import java.nio.charset.StandardCharsets; import java.nio.charset.StandardCharsets;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Iterator; import java.util.Iterator;
@ -175,6 +176,10 @@ public final class FloodgateSkinUploader {
@Override @Override
public void onError(Exception ex) { 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 (ex instanceof ConnectException || ex instanceof SSLException) {
if (logger.isDebug()) { if (logger.isDebug()) {
logger.error("[debug] Got an error", ex); logger.error("[debug] Got an error", ex);
@ -237,4 +242,4 @@ public final class FloodgateSkinUploader {
client.close(); client.close();
} }
} }
} }