aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/de/cowtipper/cowlection/util/ApiUtils.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/de/cowtipper/cowlection/util/ApiUtils.java')
-rw-r--r--src/main/java/de/cowtipper/cowlection/util/ApiUtils.java2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/main/java/de/cowtipper/cowlection/util/ApiUtils.java b/src/main/java/de/cowtipper/cowlection/util/ApiUtils.java
index 584e818..70e4328 100644
--- a/src/main/java/de/cowtipper/cowlection/util/ApiUtils.java
+++ b/src/main/java/de/cowtipper/cowlection/util/ApiUtils.java
@@ -159,6 +159,8 @@ public class ApiUtils {
connection.getResponseCode();
if (connection.getResponseCode() == HttpStatus.SC_NO_CONTENT) { // http status 204
return null;
+ } else if (connection.getResponseCode() == HttpStatus.SC_BAD_GATEWAY && url.startsWith("https://api.hypixel.net/")) { // http status 502 (cloudflare)
+ throw new IOException("Couldn't contact Hypixel API (502 Bad Gateway). API might be down, check https://status.hypixel.net for info.");
} else {
BufferedReader reader;
InputStream errorStream = connection.getErrorStream();