Rev4057, Log invalid result from websocket
This commit is contained in:
parent
a7632889a2
commit
9f5600b7f7
2 changed files with 7 additions and 2 deletions
|
@ -13,7 +13,7 @@ class Config(object):
|
|||
|
||||
def __init__(self, argv):
|
||||
self.version = "0.7.0"
|
||||
self.rev = 4056
|
||||
self.rev = 4057
|
||||
self.argv = argv
|
||||
self.action = None
|
||||
self.pending_changes = {}
|
||||
|
|
|
@ -330,7 +330,12 @@ class Actions(object):
|
|||
|
||||
ws = self.getWebsocket(site)
|
||||
ws.send(json.dumps({"cmd": cmd, "params": parameters, "id": 1}))
|
||||
res = json.loads(ws.recv())
|
||||
res_raw = ws.recv()
|
||||
try:
|
||||
res = json.loads(res_raw)
|
||||
except Exception as err:
|
||||
return {"error": "Invalid result: %s" % err, "res_raw": res_raw}
|
||||
|
||||
if "result" in res:
|
||||
return res["result"]
|
||||
else:
|
||||
|
|
Loading…
Reference in a new issue