Merge pull request #77 from sweisgerber-dev/enhancement-specific-exception

Changed generic Except. in `...GooglePlayAPI` to LoginError
This commit is contained in:
Domenico Iezzi 2019-01-23 14:39:26 +01:00 committed by GitHub
commit 23b83ad81a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -311,7 +311,7 @@ class GooglePlayAPI(object):
def executeRequestApi2(self, path, post_data=None, content_type=CONTENT_TYPE_URLENC, params=None):
if self.authSubToken is None:
raise Exception("You need to login before executing any request")
raise LoginError("You need to login before executing any request")
headers = self.getHeaders()
headers["Content-Type"] = content_type
@ -354,7 +354,7 @@ class GooglePlayAPI(object):
offset (int): is used to take result starting from an index.
"""
if self.authSubToken is None:
raise Exception("You need to login before executing any request")
raise LoginError("You need to login before executing any request")
path = SEARCH_URL + "?c=3&q={}".format(requests.utils.quote(query))
# FIXME: not sure if this toc call should be here
@ -593,7 +593,7 @@ class GooglePlayAPI(object):
"""
if self.authSubToken is None:
raise Exception("You need to login before executing any request")
raise LoginError("You need to login before executing any request")
if versionCode is None:
# pick up latest version