diff --git a/placekey/api.py b/placekey/api.py index a25e157..83df102 100644 --- a/placekey/api.py +++ b/placekey/api.py @@ -15,6 +15,7 @@ log.setLevel(logging.ERROR) log.handlers = [console_log] + class PlacekeyAPI: """ PlacekeyAPI class @@ -284,6 +285,10 @@ def make_request(data): data=json.dumps(data).encode('utf-8') ) + if response.status_code == 429: + raise RateLimitException("Rate limit exceeded", 0) + + # Assumption: A code other than 429 is handled by calling function return response return make_request