mirror of
https://github.com/romanz/electrs.git
synced 2026-08-13 12:32:52 +02:00
Propagate Electrum JSON RPC error
This commit is contained in:
parent
fe1bfe3bc1
commit
fb88bccb0a
1 changed files with 4 additions and 1 deletions
|
|
@ -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):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue