Add more details to Mojang API stack traces

This commit is contained in:
Colin McDonald 2016-05-28 00:28:40 -04:00
parent d1e3455dd3
commit f4e8513343

View File

@ -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");