From 86e069b541408181dd3f6a5c1b2223f5d758a2e3 Mon Sep 17 00:00:00 2001 From: Domenico Iezzi Date: Sat, 17 Nov 2018 10:53:14 +0100 Subject: [PATCH] Restore security error message --- gpapi/googleplay.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/gpapi/googleplay.py b/gpapi/googleplay.py index 3882c84..6508ef0 100644 --- a/gpapi/googleplay.py +++ b/gpapi/googleplay.py @@ -54,7 +54,11 @@ class RequestError(Exception): return repr(self.value) class SecurityCheckError(Exception): - pass + def __init__(self, value): + self.value = value + + def __str__(self): + return repr(self.value) class GooglePlayAPI(object): @@ -220,7 +224,9 @@ class GooglePlayAPI(object): ac2dmToken = params["auth"] elif "error" in params: 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"]) else: raise LoginError("Auth token not found.")