Skip to content

Commit 2a825f1

Browse files
committed
multi: return error if connecting to remote sub-server fails
1 parent daab70c commit 2a825f1

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

subservers/manager.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ func (s *Manager) StartIntegratedServers(lndClient lnrpc.LightningClient,
8484

8585
// ConnectRemoteSubServers creates connections to all the manager's sub-servers
8686
// that are running remotely.
87-
func (s *Manager) ConnectRemoteSubServers() {
87+
func (s *Manager) ConnectRemoteSubServers() error {
8888
s.mu.Lock()
8989
defer s.mu.Unlock()
9090

@@ -95,12 +95,12 @@ func (s *Manager) ConnectRemoteSubServers() {
9595

9696
err := ss.connectRemote()
9797
if err != nil {
98-
log.Errorf("Failed to connect to remote %s: %v",
98+
return fmt.Errorf("failed to connect to remote %s: %v",
9999
ss.Name(), err)
100-
101-
continue
102100
}
103101
}
102+
103+
return nil
104104
}
105105

106106
// RegisterRPCServices registers all the manager's sub-servers with the given

terminal.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -491,7 +491,10 @@ func (g *LightningTerminal) start() error {
491491

492492
// Initialise any connections to sub-servers that we are running in
493493
// remote mode.
494-
g.subServerMgr.ConnectRemoteSubServers()
494+
if err := g.subServerMgr.ConnectRemoteSubServers(); err != nil {
495+
return fmt.Errorf("error connecting to remote sub-servers: %v",
496+
err)
497+
}
495498

496499
// Now start the RPC proxy that will handle all incoming gRPC, grpc-web
497500
// and REST requests.

0 commit comments

Comments
 (0)