Explorar o código

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

darkfi hai 1 ano
pai
achega
a220243e56
Modificáronse 1 ficheiros con 4 adicións e 0 borrados
  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 = {}