Provide more error messages to the WARNING log

This commit is contained in:
2011-01-04 21:24:34 +00:00
parent 65b1967758
commit 22f4789a44

View File

@@ -69,8 +69,10 @@ class CachedDocumentManager(models.Manager):
try: try:
conn = urllib2.urlopen(req) conn = urllib2.urlopen(req)
except urllib2.HTTPError, e: except urllib2.HTTPError, e:
print "HTTP Error Code: %s" % e.code
raise DocumentRetrievalError(e.code) raise DocumentRetrievalError(e.code)
except urllib2.URLError, e: except urllib2.URLError, e:
print "URLError: %s" % e.reason
raise DocumentRetrievalError(e.reason) raise DocumentRetrievalError(e.reason)
doc.body = unicode(conn.read(), 'utf-8') doc.body = unicode(conn.read(), 'utf-8')