fixed missing argument and added check for exceptions when getting request token
[hermes] / package / src / org / maemo / hermes / engine / linkedin / api.py
index ca61849..0d9eb24 100644 (file)
@@ -52,7 +52,7 @@ class LinkedInApi():
         token = self._get_request_token()
         url = self._get_authorize_url(token)
         verifier = block_for_auth(True)
-        self._verify_verifier(verifier)
+        self._verify_verifier(token, verifier)
     
     
     # -----------------------------------------------------------------------
@@ -155,7 +155,10 @@ class LinkedInApi():
         connection.request(oauth_request.http_method, self.REQUEST_TOKEN_URL, headers=oauth_request.to_header())
         response = connection.getresponse().read()
         
-        token = oauth.OAuthToken.from_string(response)
+        try:
+            token = oauth.OAuthToken.from_string(response)
+        except Exception, e:
+            raise Exception("Authorization failure - failed to get request token")
         return token