Commits

Marcin Kasperski committed 3fb3f40

On login failure we provide minimal info what's going on.

  • Participants
  • Parent commits 7a3f29d

Comments (0)

Files changed (4)

sample/feed_mgmt_sample.py

 try:
     username, password = get_username_and_password()
     reader_client = GoogleReaderClient(username, password)
-except GoogleLoginFailed:
+except GoogleLoginFailed as e:
+    print "Google login failed:", e
     username, password = get_username_and_password(True)
     reader_client = GoogleReaderClient(username, password)
 

sample/querying_sample.py

 try:
     username, password = get_username_and_password()
     reader_client = GoogleReaderClient(username, password)
-except GoogleLoginFailed:
+except GoogleLoginFailed as e:
+    print "Google login failed:", e
     username, password = get_username_and_password(True)
     reader_client = GoogleReaderClient(username, password)
 

sample/search_and_detail_sample.py

 try:
     username, password = get_username_and_password()
     reader_client = GoogleReaderClient(username, password)
-except GoogleLoginFailed:
+except GoogleLoginFailed as e:
+    print "Google login failed:", e
     username, password = get_username_and_password(True)
     reader_client = GoogleReaderClient(username, password)
 

src/mekk/greader/reader_client.py

 
         try:
             f = urllib2.urlopen( request )
-        except urllib2.HTTPError, e:
+        except urllib2.HTTPError as e:
             if e.code == 403:
-                raise GoogleLoginFailed
+                raise GoogleLoginFailed("%s (%s)" % (e.reason, e.read()))
             else:
                 raise
         result = f.read()