Adding more verbose errors when login fails

This commit is contained in:
Aaron Cohen
2012-09-27 00:13:24 -07:00
parent f63924472d
commit eb16244e69
2 changed files with 29 additions and 30 deletions

View File

@@ -835,11 +835,10 @@ def searchTorrent(albumid=None, new=False, losslessOnly=False):
try:
gazelle = gazelleapi.GazelleAPI(headphones.WHATCD_USERNAME, headphones.WHATCD_PASSWORD)
except:
except Exception, e:
gazelle = None
logger.warn("What.cd credentials incorrect or site is down.")
logger.warn(u"What.cd credentials incorrect or site is down. Error: %s %s" % (e.__class__.__name__, str(e)))
search_results = {}
if gazelle:
logger.info(u"Searching %s..." % provider)
search_results = gazelle.search_torrents(artistname=semi_clean_artist_term, groupname=semi_clean_album_term,

View File

@@ -68,7 +68,7 @@ class GazelleAPI(object):
'password': self.password}
r = self.session.post(loginpage, data=data)
if r.status_code != 200:
raise LoginException
raise LoginException("Login error, http code %s" % r.status_code)
accountinfo = self.request('index')
self.userid = accountinfo['id']
self.authkey = accountinfo['authkey']