Move exception trapping to the actual location the exception occures.

This commit is contained in:
2010-09-11 19:52:18 +01:00
parent ebe3b26f8a
commit 019319bbbb

View File

@@ -48,11 +48,11 @@ class CachedDocumentManager(models.Manager):
method = 'POST'
headers = {"Content-type": "application/x-www-form-urlencoded"}
try:
conn = httplib.HTTPConnection(API_URL)
try:
conn.request(method, url_path, paramstr, headers)
except socket.error:
return None
conn.request(method, url_path, paramstr, headers)
response = conn.getresponse()
if response.status == 200: