Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion googleplaces/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,13 +161,20 @@ def _validate_response(url, response):
GooglePlaces.RESPONSE_STATUS_ZERO_RESULTS]:
error_detail = ('Request to URL %s failed with response code: %s' %
(url, response['status']))
raise GooglePlacesError(error_detail)
raise GooglePlacesAPIError(url, response['status'], error_detail)


class GooglePlacesError(Exception):
pass


class GooglePlacesAPIError(GooglePlacesError):
def __init__(self, url, status_code, *args):
super(GooglePlacesAPIError, self).__init__(*args)
self.url = url
self.status_code = status_code


class GooglePlacesAttributeError(AttributeError):
"""Exception thrown when a detailed property is unavailable.

Expand Down