Add more details to Mojang API stack traces
This commit is contained in:
parent
d1e3455dd3
commit
f4e8513343
@ -12,7 +12,7 @@ import java.util.UUID;
|
|||||||
@UtilityClass
|
@UtilityClass
|
||||||
public class MojangUtils {
|
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) {
|
public static String getName(UUID id) {
|
||||||
Request.Builder builder = new Request.Builder();
|
Request.Builder builder = new Request.Builder();
|
||||||
@ -27,7 +27,7 @@ public class MojangUtils {
|
|||||||
String name = resJson.getString("name");
|
String name = resJson.getString("name");
|
||||||
|
|
||||||
if (name == null) {
|
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");
|
APIv3.getStatsD().incrementCounter("apiv3.mojang.sessionServer.success");
|
||||||
|
Loading…
Reference in New Issue
Block a user