fix: do not print errors twice
This commit is contained in:
2 files changed
+8
-1
No files matched your search
@@ -90,7 +90,9 @@ func LogFailWithError(err error) {
|
|||||||
fmt.Fprintf(os.Stderr, " ! %s\n", e.Error())
|
fmt.Fprintf(os.Stderr, " ! %s\n", e.Error())
|
||||||
}
|
}
|
||||||
} else {
|
} 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 {
|
if errExit, ok := err.(ErrWithExitCode); ok {
|
||||||
os.Exit(errExit.ExitCode())
|
os.Exit(errExit.ExitCode())
|
||||||
|
|||||||
@@ -143,6 +143,11 @@ func CommandRun(appName string, cronID string, detached bool) error {
|
|||||||
Args: args,
|
Args: args,
|
||||||
StreamStdio: true,
|
StreamStdio: true,
|
||||||
})
|
})
|
||||||
|
if err != nil {
|
||||||
|
// return an error with an empty message to avoid
|
||||||
|
// printing the error message twice
|
||||||
|
return errors.New("")
|
||||||
|
}
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user