Raise AuthError() instead of a generic TwythonError() when first-time authentication fails. Not sure why this was being done generic before, but it makes no sense now...

This commit is contained in:
Ryan McGrath 2009-09-11 02:32:17 -04:00
parent d6f6df2045
commit a1c4b17c6d
2 changed files with 2 additions and 2 deletions

View file

@ -97,7 +97,7 @@ class setup:
simplejson.load(self.opener.open("http://twitter.com/account/verify_credentials.json"))
self.authenticated = True
except HTTPError, e:
raise TwythonError("Authentication failed with your provided credentials. Try again? (%s failure)" % `e.code`, e.code)
raise AuthError("Authentication failed with your provided credentials. Try again? (%s failure)" % `e.code`, e.code)
elif consumer_secret is not None and consumer_key is not None:
self.consumer = oauth.OAuthConsumer(self.consumer_key, self.consumer_secret)
self.connection = httplib.HTTPSConnection(SERVER)

View file

@ -97,7 +97,7 @@ class setup:
simplejson.load(self.opener.open("http://twitter.com/account/verify_credentials.json"))
self.authenticated = True
except HTTPError as e:
raise TwythonError("Authentication failed with your provided credentials. Try again? (%s failure)" % repr(e.code), e.code)
raise AuthError("Authentication failed with your provided credentials. Try again? (%s failure)" % repr(e.code), e.code)
elif consumer_secret is not None and consumer_key is not None:
self.consumer = oauth.OAuthConsumer(self.consumer_key, self.consumer_secret)
self.connection = http.client.HTTPSConnection(SERVER)