Make HTTP 410 StoryDoesNotExist in tthfanfic.org, make conn fail trace debug, not error level.

This commit is contained in:
Jim Miller 2016-03-11 10:59:56 -06:00
parent 12dd969560
commit 9ccdc4d884
2 changed files with 3 additions and 3 deletions

View file

@ -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

View file

@ -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