mirror of
https://github.com/nikdoof/test-auth.git
synced 2025-12-14 14:52:15 +00:00
Provide more error messages to the WARNING log
This commit is contained in:
@@ -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')
|
||||||
|
|||||||
Reference in New Issue
Block a user