tplugins: labels: dump response if malformed sync server response - electrum - Electrum Bitcoin wallet
HTML git clone https://git.parazyd.org/electrum
DIR Log
DIR Files
DIR Refs
DIR Submodules
---
DIR commit ec5f406f4904c1b53bdb55584da760141c502cad
DIR parent fe6367cbcd91fc10664417feb88ec0ff8d3f74b2
HTML Author: Janus <ysangkok@gmail.com>
Date: Fri, 30 Nov 2018 19:16:07 +0100
plugins: labels: dump response if malformed sync server response
Diffstat:
M electrum/plugins/labels/labels.py | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
---
DIR diff --git a/electrum/plugins/labels/labels.py b/electrum/plugins/labels/labels.py
t@@ -73,7 +73,10 @@ class LabelsPlugin(BasePlugin):
url = 'https://' + self.target_host + url
async with make_aiohttp_session(self.proxy) as session:
async with session.post(url, json=data) as result:
- return await result.json()
+ try:
+ return await result.json()
+ except Exception as e:
+ raise Exception('Could not decode: ' + await result.text()) from e
async def push_thread(self, wallet):
wallet_data = self.wallets.get(wallet, None)