提交 ec73362a 编写于 作者: B Brian Rosner

knocked down the log method when fetching a page is problematic

this has caused quite a bit of confusion by Pinax users thinking the 404s are
errors. in most cases the 404s are harmless and don't prevent the installation
or location of a package.

if there is cause for concern in this i recommend to output something once
*all* pages have been hit and all produced some sort of error.
上级 f3927dee
......@@ -2335,11 +2335,11 @@ class HTMLPage(object):
except (urllib2.HTTPError, urllib2.URLError, socket.timeout, socket.error), e:
desc = str(e)
if isinstance(e, socket.timeout):
log_meth = logger.warn
log_meth = logger.info
level =1
desc = 'timed out'
elif isinstance(e, urllib2.URLError):
log_meth = logger.warn
log_meth = logger.info
if hasattr(e, 'reason') and isinstance(e.reason, socket.timeout):
desc = 'timed out'
level = 1
......@@ -2350,7 +2350,7 @@ class HTMLPage(object):
log_meth = logger.info
level = 2
else:
log_meth = logger.warn
log_meth = logger.info
level = 1
log_meth('Could not fetch URL %s: %s' % (link, desc))
log_meth('Will skip URL %s when looking for download links for %s' % (link.url, req))
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册