Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def _get_body(self, response):
if response.status_code != 200:
raise googlemaps.exceptions.HTTPError(response.status_code)
body = response.json()
api_status = body["status"]
if api_status == "OK" or api_status == "ZERO_RESULTS":
return body
if api_status == "OVER_QUERY_LIMIT":
raise googlemaps.exceptions._OverQueryLimit(
api_status, body.get("error_message"))
raise googlemaps.exceptions.ApiError(api_status,
body.get("error_message"))