From 6b37d023105558d75357f2cb5b897660a3472b03 Mon Sep 17 00:00:00 2001 From: Dustyn Gibson <miigotu@gmail.com> Date: Sun, 12 Jul 2015 01:59:38 -0700 Subject: [PATCH] Warn on 404, not exception in Trakt - Fixes SiCKRAGETV/sickrage-issues#2072 --- lib/trakt/trakt.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/trakt/trakt.py b/lib/trakt/trakt.py index d9f9069a..08808bf2 100644 --- a/lib/trakt/trakt.py +++ b/lib/trakt/trakt.py @@ -95,11 +95,11 @@ class TraktAPI(): # This is pretty much a fatal error if there is no status_code # It means there basically was no response at all raise traktException(e) - elif code == 502: + elif code is 502: # Retry the request, cloudflare had a proxying issue logger.log(u'Retrying trakt api request: %s' % path, logger.WARNING) 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) if self.traktToken(refresh=True, count=count): return self.traktRequest(path, data, headers, url, method) @@ -108,6 +108,9 @@ class TraktAPI(): #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) return {} + elif code is 404: + logger.log(u'Trakt error (404) the resource does not exist: %s' % url + path, logger.WARNING) + return {} else: raise traktException(e) -- GitLab