mirror of
https://github.com/romanz/electrs.git
synced 2024-11-19 09:54:09 +01:00
Propagate Electrum JSON RPC error
This commit is contained in:
parent
fe1bfe3bc1
commit
fb88bccb0a
@ -17,7 +17,10 @@ class Client:
|
|||||||
msg = json.dumps(requests) + '\n'
|
msg = json.dumps(requests) + '\n'
|
||||||
self.s.sendall(msg.encode('ascii'))
|
self.s.sendall(msg.encode('ascii'))
|
||||||
response = json.loads(self.f.readline())
|
response = json.loads(self.f.readline())
|
||||||
|
try:
|
||||||
return [r['result'] for r in response]
|
return [r['result'] for r in response]
|
||||||
|
except KeyError:
|
||||||
|
raise ValueError(response)
|
||||||
|
|
||||||
|
|
||||||
def request(method, *args):
|
def request(method, *args):
|
||||||
|
Loading…
Reference in New Issue
Block a user