1
0
mirror of https://github.com/GeyserMC/Floodgate.git synced 2025-12-30 12:19:22 +00:00

Don't throw an exception when Floodgate can't connect to the api

This commit is contained in:
Tim203
2021-02-27 13:24:37 +01:00
parent f53032e9ea
commit 7d787d0135

View File

@@ -29,6 +29,8 @@ import static org.geysermc.floodgate.util.Constants.WEBSOCKET_URL;
import com.google.gson.Gson;
import com.google.gson.JsonObject;
import com.google.gson.JsonSyntaxException;
import java.net.ConnectException;
import java.net.URI;
import lombok.Getter;
import org.geysermc.floodgate.api.FloodgateApi;
@@ -131,6 +133,10 @@ final class SkinUploadSocket extends WebSocketClient {
@Override
public void onError(Exception exception) {
// skip can't connect exceptions and the syntax error in onClose because of that.
if (exception instanceof ConnectException || exception instanceof JsonSyntaxException) {
return;
}
logger.error("Got an error", exception);
}
}