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:
parent
d6f6df2045
commit
a1c4b17c6d
2 changed files with 2 additions and 2 deletions
|
|
@ -97,7 +97,7 @@ class setup:
|
||||||
simplejson.load(self.opener.open("http://twitter.com/account/verify_credentials.json"))
|
simplejson.load(self.opener.open("http://twitter.com/account/verify_credentials.json"))
|
||||||
self.authenticated = True
|
self.authenticated = True
|
||||||
except HTTPError, e:
|
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:
|
elif consumer_secret is not None and consumer_key is not None:
|
||||||
self.consumer = oauth.OAuthConsumer(self.consumer_key, self.consumer_secret)
|
self.consumer = oauth.OAuthConsumer(self.consumer_key, self.consumer_secret)
|
||||||
self.connection = httplib.HTTPSConnection(SERVER)
|
self.connection = httplib.HTTPSConnection(SERVER)
|
||||||
|
|
|
||||||
|
|
@ -97,7 +97,7 @@ class setup:
|
||||||
simplejson.load(self.opener.open("http://twitter.com/account/verify_credentials.json"))
|
simplejson.load(self.opener.open("http://twitter.com/account/verify_credentials.json"))
|
||||||
self.authenticated = True
|
self.authenticated = True
|
||||||
except HTTPError as e:
|
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:
|
elif consumer_secret is not None and consumer_key is not None:
|
||||||
self.consumer = oauth.OAuthConsumer(self.consumer_key, self.consumer_secret)
|
self.consumer = oauth.OAuthConsumer(self.consumer_key, self.consumer_secret)
|
||||||
self.connection = http.client.HTTPSConnection(SERVER)
|
self.connection = http.client.HTTPSConnection(SERVER)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue