From cf7f7f40ca087d7a8c7e0563ea985d54ae6541be Mon Sep 17 00:00:00 2001 From: Kostya Esmukov Date: Tue, 23 Mar 2021 01:34:23 +0300 Subject: [PATCH] GoogleV3: raise GeocoderQuotaExceeded for OVER_DAILY_LIMIT --- geopy/geocoders/googlev3.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/geopy/geocoders/googlev3.py b/geopy/geocoders/googlev3.py index cba1acbe9..d88b6f1d8 100644 --- a/geopy/geocoders/googlev3.py +++ b/geopy/geocoders/googlev3.py @@ -410,13 +410,11 @@ def parse_place(place): return [parse_place(place) for place in places] def _check_status(self, status): - """ - Validates error statuses. - """ + # https://developers.google.com/maps/documentation/geocoding/overview#StatusCodes if status == 'ZERO_RESULTS': # When there are no results, just return. return - if status == 'OVER_QUERY_LIMIT': + if status in ('OVER_QUERY_LIMIT', 'OVER_DAILY_LIMIT'): raise GeocoderQuotaExceeded( 'The given key has gone over the requests limit in the 24' ' hour period or has submitted too many requests in too'