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' method = 'POST'
headers = {"Content-type": "application/x-www-form-urlencoded"} headers = {"Content-type": "application/x-www-form-urlencoded"}
conn = httplib.HTTPConnection(API_URL)
try: try:
conn = httplib.HTTPConnection(API_URL) conn.request(method, url_path, paramstr, headers)
except socket.error: except socket.error:
return None return None
conn.request(method, url_path, paramstr, headers)
response = conn.getresponse() response = conn.getresponse()
if response.status == 200: if response.status == 200: