provide more info in sync error messages; catch zlib decode errors

This commit is contained in:
Damien Elmes 2010-12-07 16:48:49 +09:00
parent 2013e7e4ff
commit a383223e02

View file

@ -1143,12 +1143,17 @@ class HttpSyncServerProxy(SyncServer):
try: try:
f = urllib2.urlopen(SYNC_URL + action, data) f = urllib2.urlopen(SYNC_URL + action, data)
except (urllib2.URLError, socket.error, socket.timeout, except (urllib2.URLError, socket.error, socket.timeout,
httplib.BadStatusLine): httplib.BadStatusLine), e:
raise SyncError(type="noResponse") raise SyncError(type="connectionError",
exc=`e`)
ret = f.read() ret = f.read()
if not ret: if not ret:
raise SyncError(type="noResponse") raise SyncError(type="noResponse")
return self.unstuff(ret) try:
return self.unstuff(ret)
except Exception, e:
raise SyncError(type="connectionError",
exc=`e`)
# HTTP server: respond to proxy requests and return data # HTTP server: respond to proxy requests and return data
########################################################################## ##########################################################################