From 2472bc736080bea0ba05fc1346316ba160c6a74a Mon Sep 17 00:00:00 2001 From: Kai Moritz Date: Tue, 29 Oct 2019 16:25:52 +0100 Subject: [PATCH] Renamed exception for rate-limit-exceeded --- src/main/java/de/juplo/facebook/errors/GraphApiException.java | 2 +- ...tReachedException.java => RateLimitExceededException.java} | 4 ++-- .../de/juplo/facebook/errors/GraphApiErrorHandlerTest.java | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) rename src/main/java/de/juplo/facebook/errors/{CustomRequestLimitReachedException.java => RateLimitExceededException.java} (88%) diff --git a/src/main/java/de/juplo/facebook/errors/GraphApiException.java b/src/main/java/de/juplo/facebook/errors/GraphApiException.java index 7263c4f..31c23dc 100644 --- a/src/main/java/de/juplo/facebook/errors/GraphApiException.java +++ b/src/main/java/de/juplo/facebook/errors/GraphApiException.java @@ -200,7 +200,7 @@ public class GraphApiException extends RuntimeException // 500..599: application messaging errors ? case 506: return new MultipleConcurrentPostsException(status, headers, error); // 600..699: FQL errors - case 613: return new CustomRequestLimitReachedException(status, headers, error); + case 613: return new RateLimitExceededException(status, headers, error); // 700..749: ref errors // 750..799: application integration errors // 900..949: application information errors diff --git a/src/main/java/de/juplo/facebook/errors/CustomRequestLimitReachedException.java b/src/main/java/de/juplo/facebook/errors/RateLimitExceededException.java similarity index 88% rename from src/main/java/de/juplo/facebook/errors/CustomRequestLimitReachedException.java rename to src/main/java/de/juplo/facebook/errors/RateLimitExceededException.java index be3caa2..e0d9589 100644 --- a/src/main/java/de/juplo/facebook/errors/CustomRequestLimitReachedException.java +++ b/src/main/java/de/juplo/facebook/errors/RateLimitExceededException.java @@ -15,9 +15,9 @@ import org.springframework.http.HttpStatus; * If you do not see the subcode, your app is exceeding a custom rate limit. Please contact your Partner Manager for help resolving this issue. * @author Kai Moritz */ -public class CustomRequestLimitReachedException extends OAuthException +public class RateLimitExceededException extends OAuthException { - protected CustomRequestLimitReachedException( + protected RateLimitExceededException( HttpStatus status, HttpHeaders headers, FacebookErrorMessage error diff --git a/src/test/java/de/juplo/facebook/errors/GraphApiErrorHandlerTest.java b/src/test/java/de/juplo/facebook/errors/GraphApiErrorHandlerTest.java index 185fd2b..dde664e 100644 --- a/src/test/java/de/juplo/facebook/errors/GraphApiErrorHandlerTest.java +++ b/src/test/java/de/juplo/facebook/errors/GraphApiErrorHandlerTest.java @@ -275,7 +275,7 @@ public class GraphApiErrorHandlerTest clientTemplate.getForObject("ANY", SOME.class); fail("The expected exception was not thrown"); } - catch(CustomRequestLimitReachedException e) + catch(RateLimitExceededException e) { log.debug("{}", e.toString()); assertEquals(new Integer(613), e.getCode()); -- 2.20.1