1
0
mirror of https://github.com/romanz/electrs.git synced 2024-11-19 01:43:29 +01:00

Propagate Electrum JSON RPC error

This commit is contained in:
Roman Zeyde 2021-08-28 20:05:39 +03:00
parent fe1bfe3bc1
commit fb88bccb0a

View File

@ -17,7 +17,10 @@ class Client:
msg = json.dumps(requests) + '\n'
self.s.sendall(msg.encode('ascii'))
response = json.loads(self.f.readline())
return [r['result'] for r in response]
try:
return [r['result'] for r in response]
except KeyError:
raise ValueError(response)
def request(method, *args):