From c56110b3a72ad600c421af701c3c17ff4938108f Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Thu, 13 Nov 2025 01:52:08 -0500 Subject: [PATCH] fix: do not print errors twice --- plugins/common/log.go | 4 +++- plugins/cron/subcommands.go | 5 +++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/plugins/common/log.go b/plugins/common/log.go index 9a3281138..9e67287b4 100644 --- a/plugins/common/log.go +++ b/plugins/common/log.go @@ -90,7 +90,9 @@ func LogFailWithError(err error) { fmt.Fprintf(os.Stderr, " ! %s\n", e.Error()) } } else { - fmt.Fprintf(os.Stderr, " ! %s\n", err.Error()) + if err.Error() != "" { + fmt.Fprintf(os.Stderr, " ! %s\n", err.Error()) + } } if errExit, ok := err.(ErrWithExitCode); ok { os.Exit(errExit.ExitCode()) diff --git a/plugins/cron/subcommands.go b/plugins/cron/subcommands.go index c47fa3289..c46ba4771 100644 --- a/plugins/cron/subcommands.go +++ b/plugins/cron/subcommands.go @@ -143,6 +143,11 @@ func CommandRun(appName string, cronID string, detached bool) error { Args: args, StreamStdio: true, }) + if err != nil { + // return an error with an empty message to avoid + // printing the error message twice + return errors.New("") + } return err }