From a1c4b17c6d9d24ea2986f25fa85cf8aaf3ae2c29 Mon Sep 17 00:00:00 2001 From: Ryan McGrath Date: Fri, 11 Sep 2009 02:32:17 -0400 Subject: [PATCH] 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... --- twython.py | 2 +- twython3k.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/twython.py b/twython.py index dd0cd27..7015fa8 100644 --- a/twython.py +++ b/twython.py @@ -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) diff --git a/twython3k.py b/twython3k.py index 08db6ad..bc8fdb9 100644 --- a/twython3k.py +++ b/twython3k.py @@ -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)