Skip to content

Commit

Permalink
GoogleV3: raise GeocoderQuotaExceeded for OVER_DAILY_LIMIT
Browse files Browse the repository at this point in the history
  • Loading branch information
KostyaEsmukov committed Mar 24, 2021
1 parent a825a5d commit cf7f7f4
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions geopy/geocoders/googlev3.py
Expand Up @@ -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'
Expand Down

0 comments on commit cf7f7f4

Please sign in to comment.