From fb88bccb0ab8df1bedb5c1fd974fa9a48b04b9de Mon Sep 17 00:00:00 2001 From: Roman Zeyde Date: Sat, 28 Aug 2021 20:05:39 +0300 Subject: [PATCH] Propagate Electrum JSON RPC error --- contrib/client.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/contrib/client.py b/contrib/client.py index 74e74fe..5c561f2 100644 --- a/contrib/client.py +++ b/contrib/client.py @@ -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):