loopd: log correct error if daemon start fails

This commit is contained in:
Slyghtning 2025-08-19 14:12:44 +02:00
parent cc26813f24
commit bd6271e633
No known key found for this signature in database
GPG key ID: F82D456EA023C9BF

View file

@ -64,15 +64,15 @@ type ListenerCfg struct {
// Daemon is the struct that holds one instance of the loop client daemon.
type Daemon struct {
// To be used atomically. Declared first to optimize struct alignment.
started int32
// swapClientServer is the embedded RPC server that satisfies the client
// RPC interface. We embed this struct so the Daemon itself can be
// registered to an existing grpc.Server to run as a subserver in the
// same process.
swapClientServer
// To be used atomically.
started int32
// ErrChan is an error channel that users of the Daemon struct must use
// to detect runtime errors and also whether a shutdown is fully
// completed.
@ -168,7 +168,7 @@ func (d *Daemon) Start() error {
// anything goes wrong now, we need to cleanly shut down again.
startErr := d.startWebServers()
if startErr != nil {
errorf("Error while starting daemon: %v", err)
errorf("Error while starting daemon: %v", startErr)
d.Stop()
stopErr := <-d.ErrChan
if stopErr != nil {