aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/me/Danker/handlers/APIHandler.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/me/Danker/handlers/APIHandler.java')
-rw-r--r--src/main/java/me/Danker/handlers/APIHandler.java5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/main/java/me/Danker/handlers/APIHandler.java b/src/main/java/me/Danker/handlers/APIHandler.java
index 34a73ff..b8d52dc 100644
--- a/src/main/java/me/Danker/handlers/APIHandler.java
+++ b/src/main/java/me/Danker/handlers/APIHandler.java
@@ -53,8 +53,11 @@ public class APIHandler {
JsonObject object = gson.fromJson(error, JsonObject.class);
return object;
}
+ } else if (urlString.startsWith("https://api.mojang.com/users/profiles/minecraft/") && conn.getResponseCode() == 204) {
+ player.addChatMessage(new ChatComponentText(EnumChatFormatting.RED + "Failed with reason: Player does not exist."));
+ } else {
+ player.addChatMessage(new ChatComponentText(EnumChatFormatting.RED + "Request failed. HTTP Error Code: " + conn.getResponseCode()));
}
- player.addChatMessage(new ChatComponentText(EnumChatFormatting.RED + "Request failed. HTTP Error Code: " + conn.getResponseCode()));
}
} catch (MalformedURLException ex) {
player.addChatMessage(new ChatComponentText(EnumChatFormatting.RED + "An error has occured. See logs for more details."));