Private GIT

Skip to content
Snippets Groups Projects
Commit 6b37d023 authored by Dustyn Gibson's avatar Dustyn Gibson
Browse files

Warn on 404, not exception in Trakt - Fixes SiCKRAGETV/sickrage-issues#2072

parent f7d43b41
No related branches found
No related tags found
No related merge requests found
...@@ -95,11 +95,11 @@ class TraktAPI(): ...@@ -95,11 +95,11 @@ class TraktAPI():
# This is pretty much a fatal error if there is no status_code # This is pretty much a fatal error if there is no status_code
# It means there basically was no response at all # It means there basically was no response at all
raise traktException(e) raise traktException(e)
elif code == 502: elif code is 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)
return self.traktRequest(path, data, headers, url, method) return self.traktRequest(path, data, headers, url, method)
elif code == 401: elif code is 401:
logger.log(u'Unauthorized. Please check your Trakt settings', logger.WARNING) logger.log(u'Unauthorized. Please check your Trakt settings', logger.WARNING)
if self.traktToken(refresh=True, count=count): if self.traktToken(refresh=True, count=count):
return self.traktRequest(path, data, headers, url, method) return self.traktRequest(path, data, headers, url, method)
...@@ -108,6 +108,9 @@ class TraktAPI(): ...@@ -108,6 +108,9 @@ class TraktAPI():
#http://docs.trakt.apiary.io/#introduction/status-codes #http://docs.trakt.apiary.io/#introduction/status-codes
logger.log(u'Trakt may have some issues and it\'s unavailable. Try again later please', logger.WARNING) logger.log(u'Trakt may have some issues and it\'s unavailable. Try again later please', logger.WARNING)
return {} return {}
elif code is 404:
logger.log(u'Trakt error (404) the resource does not exist: %s' % url + path, logger.WARNING)
return {}
else: else:
raise traktException(e) raise traktException(e)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment