cmd/cli: handle ipc warning message more precisely

If the socket file does not exist, it means that "ctrld start" was never
run. In this case, the warning message should not be printed to avoid
needless confusion.
This commit is contained in:
Cuong Manh Le authored and Cuong Manh Le committed 2025-04-17 17:12:06 +07:00
1 parent 24910f1fa6
commit 7dfb77228f
1 file changed
+3 -1
+3 -1
View File
@@ -227,7 +227,9 @@ func run(appCallback *AppCallback, stopCh chan struct{}) {
consoleWriter.Out = io.MultiWriter(os.Stdout, lc) consoleWriter.Out = io.MultiWriter(os.Stdout, lc)
p.logConn = lc p.logConn = lc
} else { } else {
mainLog.Load().Warn().Err(err).Msgf("unable to create log ipc connection") if !errors.Is(err, os.ErrNotExist) {
mainLog.Load().Warn().Err(err).Msg("unable to create log ipc connection")
}
} }
} else { } else {
mainLog.Load().Warn().Err(err).Msgf("unable to resolve socket address: %s", sockPath) mainLog.Load().Warn().Err(err).Msgf("unable to resolve socket address: %s", sockPath)