mirror of
https://github.com/moparisthebest/SickRage
synced 2025-01-07 03:48:02 -05:00
Make sure we're returning the result of the recursive request
This commit is contained in:
parent
a3bb636df2
commit
9cfc3e3788
@ -29,7 +29,11 @@ class TraktAPI():
|
|||||||
resp.raise_for_status()
|
resp.raise_for_status()
|
||||||
resp = resp.json()
|
resp = resp.json()
|
||||||
except (requests.HTTPError, requests.ConnectionError) as e:
|
except (requests.HTTPError, requests.ConnectionError) as e:
|
||||||
if e.response.status_code == 401:
|
if e.response.status_code == 502:
|
||||||
|
# Retry the request, cloudflare had a proxying issue
|
||||||
|
logger.log(u"Retrying trakt api request: auth/login", logger.WARNING)
|
||||||
|
return self.validateAccount()
|
||||||
|
elif e.response.status_code == 401:
|
||||||
raise traktAuthException(e)
|
raise traktAuthException(e)
|
||||||
if 'token' in resp:
|
if 'token' in resp:
|
||||||
self.token = resp['token']
|
self.token = resp['token']
|
||||||
@ -57,7 +61,7 @@ class TraktAPI():
|
|||||||
if e.response.status_code == 502:
|
if e.response.status_code == 502:
|
||||||
# Retry the request, cloudflare had a proxying issue
|
# Retry the request, cloudflare had a proxying issue
|
||||||
logger.log(u"Retrying trakt api request: %s" % path, logger.WARNING)
|
logger.log(u"Retrying trakt api request: %s" % path, logger.WARNING)
|
||||||
self.traktRequest(path, data, method)
|
return self.traktRequest(path, data, method)
|
||||||
elif e.response.status_code == 401:
|
elif e.response.status_code == 401:
|
||||||
raise traktAuthException(e)
|
raise traktAuthException(e)
|
||||||
elif e.response.status_code == 503:
|
elif e.response.status_code == 503:
|
||||||
|
Loading…
Reference in New Issue
Block a user