mirror of
https://github.com/aljazceru/lightning.git
synced 2026-02-07 23:24:21 +01:00
pylightning: Responses may not be iterable
This commit is contained in:
committed by
Christian Decker
parent
48728d3828
commit
152f9b66b9
@@ -229,7 +229,9 @@ class UnixDomainSocketRpc(object):
|
||||
sock.close()
|
||||
|
||||
self.logger.debug("Received response for %s call: %r", method, resp)
|
||||
if "error" in resp:
|
||||
if not isinstance(resp, dict):
|
||||
raise ValueError("Malformed response, response is not a dictionary %s." % resp)
|
||||
elif "error" in resp:
|
||||
raise RpcError(method, payload, resp['error'])
|
||||
elif "result" not in resp:
|
||||
raise ValueError("Malformed response, \"result\" missing.")
|
||||
|
||||
Reference in New Issue
Block a user