Skip to content

Commit

Permalink
fix: suppress command help error which was not meant to be logged
Browse files Browse the repository at this point in the history
  • Loading branch information
reubenmiller committed Feb 16, 2025
1 parent 29cb4f9 commit c5b6a3f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pkg/cmd/root/root.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package root

import (
"errors"
"fmt"
"io/fs"
"os"
Expand Down Expand Up @@ -194,7 +195,9 @@ func NewCmdRoot(f *cmdutil.Factory, version, buildDate string) *CmdRoot {
if cmdErr != nil {
logg, logErr := f.Logger()
if logg != nil && logErr == nil {
logg.Warnf("Check existing session failed. %s", cmdErr)
if !errors.Is(cmderrors.ErrHelp, cmdErr) {
logg.Warnf("Check existing session failed. %s", cmdErr)
}
}
}
return cmdErr
Expand Down

0 comments on commit c5b6a3f

Please sign in to comment.