File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change 2121lightning_selector = "mission=lightning"
2222
2323
24+ class SimLNError (Exception ):
25+ pass
26+
27+
2428def run_simln ():
2529 """Run a SimLN Plugin demo"""
2630 init_network ()
@@ -48,8 +52,13 @@ def _prepare_and_launch_activity() -> str:
4852def get_example_activity () -> list [dict ]:
4953 """Get an activity representing node 2 sending msat to node 3"""
5054 pods = get_pods_with_label (lightning_selector )
51- pod_a = pods [1 ].metadata .name
52- pod_b = pods [2 ].metadata .name
55+ try :
56+ pod_a = pods [1 ].metadata .name
57+ pod_b = pods [2 ].metadata .name
58+ except Exception as err :
59+ raise SimLNError (
60+ "Could not access the lightning nodes needed for the example.\n Try deploying some."
61+ ) from err
5362 return [{"source" : pod_a , "destination" : pod_b , "interval_secs" : 1 , "amount_msat" : 2000 }]
5463
5564
You can’t perform that action at this time.
0 commit comments