Raise exception when no response received

This commit is contained in:
shortcutme 2017-10-03 15:23:25 +02:00
parent f9e64bc874
commit 1c029981ae
No known key found for this signature in database
GPG key ID: 5B63BAE6CB9613AE

View file

@ -141,7 +141,10 @@ class Peer(object):
else: # Successful request, reset connection error num
self.connection_error = 0
self.time_response = time.time()
return res
if res:
return res
else:
raise Exception("Invalid response: %s" % res)
except Exception, err:
if type(err).__name__ == "Notify": # Greenlet killed by worker
self.log("Peer worker got killed: %s, aborting cmd: %s" % (err.message, cmd))