Restore security error message

This commit is contained in:
Domenico Iezzi 2018-11-17 10:53:14 +01:00
parent 588b17eb7c
commit 86e069b541
No known key found for this signature in database
GPG Key ID: D8CE73FC9E4393C3

View File

@ -54,7 +54,11 @@ class RequestError(Exception):
return repr(self.value) return repr(self.value)
class SecurityCheckError(Exception): class SecurityCheckError(Exception):
pass def __init__(self, value):
self.value = value
def __str__(self):
return repr(self.value)
class GooglePlayAPI(object): class GooglePlayAPI(object):
@ -220,7 +224,9 @@ class GooglePlayAPI(object):
ac2dmToken = params["auth"] ac2dmToken = params["auth"]
elif "error" in params: elif "error" in params:
if "NeedsBrowser" in params["error"]: if "NeedsBrowser" in params["error"]:
raise SecurityCheckError() raise SecurityCheckError("Security check is needed, try to visit "
"https://accounts.google.com/b/0/DisplayUnlockCaptcha "
"to unlock, or setup an app-specific passwor")
raise LoginError("server says: " + params["error"]) raise LoginError("server says: " + params["error"])
else: else:
raise LoginError("Auth token not found.") raise LoginError("Auth token not found.")