Reimplementation of {c:8a0b67} following garage/git cock-up. Better
authorAndrew Flegg <andrew@bleb.org>
Sun, 2 Jan 2011 20:03:58 +0000 (20:03 +0000)
committerAndrew Flegg <andrew@bleb.org>
Sun, 2 Jan 2011 20:03:58 +0000 (20:03 +0000)
catches Twitter expired credentials.

package/src/org/maemo/hermes/engine/twitter/api.py

index b20032c..95cdf61 100644 (file)
@@ -28,7 +28,10 @@ class TwitterApi():
             json = self._make_api_request(url % (cursor))
             data = simplejson.loads(json)
             if 'error' in data:
-                raise Exception(data['error'])
+                if data['error'] == 'This method requires authentication.':
+                    raise CredentialsExpiredException('Twitter')
+                else:
+                    raise Exception(data['error'])
 
             for x in data['users']:
                 users.append(User.NewFromJsonDict(x))