Skip to content

Commit

Permalink
Change the API not found error message #3670)
Browse files Browse the repository at this point in the history
  • Loading branch information
onebeastchris authored May 7, 2023
1 parent 0d25a3f commit 33d50cb
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
3 changes: 1 addition & 2 deletions core/src/main/java/org/geysermc/geyser/Constants.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@

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;
Expand Down Expand Up @@ -175,6 +176,10 @@ public void onClose(int code, String reason, boolean remote) {

@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);
Expand Down Expand Up @@ -237,4 +242,4 @@ public void close() {
client.close();
}
}
}
}

0 comments on commit 33d50cb

Please sign in to comment.