diff --git a/cmd/root/root.go b/cmd/root/root.go index 91e91d36..61baa4da 100644 --- a/cmd/root/root.go +++ b/cmd/root/root.go @@ -98,7 +98,7 @@ func Execute(cmd *cobra.Command) { // Run the command cmd, err := cmd.ExecuteContextC(ctx) - if err != nil && errors.Is(err, ErrAlreadyPrinted) { + if err != nil && !errors.Is(err, ErrAlreadyPrinted) { // If cmdio logger initialization succeeds, then this function logs with the // initialized cmdio logger, otherwise with the default cmdio logger cmdio.LogError(cmd.Context(), err)