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 21
21
lightning_selector = "mission=lightning"
22
22
23
23
24
+ class SimLNError (Exception ):
25
+ pass
26
+
27
+
24
28
def run_simln ():
25
29
"""Run a SimLN Plugin demo"""
26
30
init_network ()
@@ -48,8 +52,13 @@ def _prepare_and_launch_activity() -> str:
48
52
def get_example_activity () -> list [dict ]:
49
53
"""Get an activity representing node 2 sending msat to node 3"""
50
54
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
53
62
return [{"source" : pod_a , "destination" : pod_b , "interval_secs" : 1 , "amount_msat" : 2000 }]
54
63
55
64
You can’t perform that action at this time.
0 commit comments