From 9ccdc4d884048a4ff970d9e9f0ce95c075beace1 Mon Sep 17 00:00:00 2001 From: Jim Miller Date: Fri, 11 Mar 2016 10:59:56 -0600 Subject: [PATCH] Make HTTP 410 StoryDoesNotExist in tthfanfic.org, make conn fail trace debug, not error level. --- fanficfare/adapters/adapter_tthfanficorg.py | 2 +- fanficfare/adapters/base_adapter.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/fanficfare/adapters/adapter_tthfanficorg.py b/fanficfare/adapters/adapter_tthfanficorg.py index feff558..4c4d334 100644 --- a/fanficfare/adapters/adapter_tthfanficorg.py +++ b/fanficfare/adapters/adapter_tthfanficorg.py @@ -131,7 +131,7 @@ class TwistingTheHellmouthSiteAdapter(BaseSiteAdapter): #print("data:%s"%data) soup = self.make_soup(data) except urllib2.HTTPError, e: - if e.code == 404: + if e.code in (404,410): raise exceptions.StoryDoesNotExist(url) else: raise e diff --git a/fanficfare/adapters/base_adapter.py b/fanficfare/adapters/base_adapter.py index a1dc29e..a5b462f 100644 --- a/fanficfare/adapters/base_adapter.py +++ b/fanficfare/adapters/base_adapter.py @@ -338,7 +338,7 @@ class BaseSiteAdapter(Configurable): return (self._decode(data),opened) except u2.HTTPError, he: excpt=he - if he.code in (403,404): + if he.code in (403,404,410): logger.warn("Caught an exception reading URL: %s Exception %s."%(unicode(url),unicode(he))) break # break out on 404 except Exception, e: @@ -346,7 +346,7 @@ class BaseSiteAdapter(Configurable): logger.warn("Caught an exception reading URL: %s sleeptime(%s) Exception %s."%(unicode(url),sleeptime,unicode(e))) logger.error("Giving up on %s" %url) - logger.exception(excpt) + logger.debug(excpt, exc_info=True) raise(excpt) # Limit chapters to download. Input starts at 1, list starts at 0