From 7dfb77228f0924d87265562bbef22788070d37ee Mon Sep 17 00:00:00 2001 From: Cuong Manh Le Date: Tue, 8 Apr 2025 22:23:23 +0700 Subject: [PATCH] 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. --- cmd/cli/cli.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cmd/cli/cli.go b/cmd/cli/cli.go index ecdd113..31e1fcb 100644 --- a/cmd/cli/cli.go +++ b/cmd/cli/cli.go @@ -227,7 +227,9 @@ func run(appCallback *AppCallback, stopCh chan struct{}) { consoleWriter.Out = io.MultiWriter(os.Stdout, lc) p.logConn = lc } 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 { mainLog.Load().Warn().Err(err).Msgf("unable to resolve socket address: %s", sockPath)