mirror of
https://github.com/rembo10/headphones.git
synced 2026-05-02 17:59:28 +01:00
Adding more verbose errors when login fails
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -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']
|
||||
|
||||
Reference in New Issue
Block a user