aboutsummaryrefslogtreecommitdiff
path: root/h-client/hlibrary.py
diff options
context:
space:
mode:
Diffstat (limited to 'h-client/hlibrary.py')
-rw-r--r--h-client/hlibrary.py15
1 files changed, 10 insertions, 5 deletions
diff --git a/h-client/hlibrary.py b/h-client/hlibrary.py
index 415b04b..3205fbd 100644
--- a/h-client/hlibrary.py
+++ b/h-client/hlibrary.py
@@ -337,11 +337,16 @@ class Mycurl:
c.setopt(c.POSTFIELDS, urllib.urlencode(self._post))
c.setopt(c.WRITEFUNCTION, self.body_callback)
- c.perform()
-
- result = False
- if c.getinfo(c.HTTP_CODE) == 200:
+ try:
+ c.perform()
result = True
+ except:
+ result = False
+
+ #print c.getinfo(c.HTTP_CODE)
+ #result = False
+ #if c.getinfo(c.HTTP_CODE) == 200:
+ #result = True
c.close()
return result
@@ -573,7 +578,7 @@ class Client:
dev[3] = idDevice
else:
self._status = False
- self.errors.append("couldn't connect to host")
+ self.errors.append("unable to connect to server")
def submit(self):
for key,dev in self.devices.iteritems():