diff --git a/src/main/java/net/frozenorb/apiv3/utils/MojangUtils.java b/src/main/java/net/frozenorb/apiv3/utils/MojangUtils.java index 13bf39b..fc5626b 100644 --- a/src/main/java/net/frozenorb/apiv3/utils/MojangUtils.java +++ b/src/main/java/net/frozenorb/apiv3/utils/MojangUtils.java @@ -12,7 +12,7 @@ import java.util.UUID; @UtilityClass public class MojangUtils { - private static OkHttpClient okHttpClient = new OkHttpClient(); + private static OkHttpClient okHttpClient = new OkHttpClient.Builder().retryOnConnectionFailure(false).build(); public static String getName(UUID id) { Request.Builder builder = new Request.Builder(); @@ -27,7 +27,7 @@ public class MojangUtils { String name = resJson.getString("name"); if (name == null) { - throw new RuntimeException("Hit Mojang API rate limit"); + throw new RuntimeException("Hit Mojang API rate limit: " + resJson.toJson()); } APIv3.getStatsD().incrementCounter("apiv3.mojang.sessionServer.success");