浏览代码

script/node_get-info.py: handle RPC error responses

darkfi 1 年之前
父节点
当前提交
a220243e56
共有 1 个文件被更改,包括 4 次插入0 次删除
  1. 4 0
      script/node_get-info.py

+ 4 - 0
script/node_get-info.py

@@ -82,6 +82,10 @@ async def main(argv):
         except OSError:
             pass
     response = await rpc._make_request("p2p.get_info", [])
+    if "error" in response:
+        print("Error: ", response["error"])
+        await rpc.stop()
+        return
     info = response["result"]
     channels = info["channels"]
     channel_lookup = {}