diff --git a/src/Config.py b/src/Config.py index be93c813..e8ed3773 100644 --- a/src/Config.py +++ b/src/Config.py @@ -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 = {} diff --git a/src/main.py b/src/main.py index 96410247..8cbbad6a 100644 --- a/src/main.py +++ b/src/main.py @@ -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: