From dd9c8cc0af40550b927a4a5bca50dc3117272e67 Mon Sep 17 00:00:00 2001 From: Julian Arndt Date: Sun, 10 Jan 2021 19:44:16 +0100 Subject: [PATCH] Add additional check for error --- src/main/java/de/jeyp91/apifootball/APIFootballUpdater.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main/java/de/jeyp91/apifootball/APIFootballUpdater.java b/src/main/java/de/jeyp91/apifootball/APIFootballUpdater.java index fd33eab..7b1196f 100644 --- a/src/main/java/de/jeyp91/apifootball/APIFootballUpdater.java +++ b/src/main/java/de/jeyp91/apifootball/APIFootballUpdater.java @@ -16,6 +16,7 @@ public class APIFootballUpdater { private final String exceededLimitDayError = "{\"api\":{\"results\":0,\"error\":\"You have reached the request limit for the day\"}}"; private final String exceededLimitMinuteError = "{\"api\":{\"results\":0,\"error\":\"Too many requests. Your rate limit is 10 requests per minute.\"}}"; + private final String exceededLimitMinuteError2 = "{\"api\":{\"results\":0,\"status\":\"Too many requests. Your rate limit is 10 requests per minute.\"}}"; private final String wrongEndpointError = "{\"api\":{\"results\":0,\"error\":\"This endpoint does not exist or your parameters are incorrect, contact our support.\"}}"; public APIFootballUpdater() { @@ -103,6 +104,9 @@ public class APIFootballUpdater { if (result.toString().equals(exceededLimitMinuteError)) { throw new Exception(requestUrl + " gave error:" + exceededLimitMinuteError); } + if (result.toString().equals(exceededLimitMinuteError2)) { + throw new Exception(requestUrl + " gave error:" + exceededLimitMinuteError2); + } return result.toString(); }