From 3ecd79f07615954fd4f76540b35303529b229348 Mon Sep 17 00:00:00 2001 From: James Bohnert Date: Tue, 26 Dec 2023 06:06:58 -0600 Subject: [PATCH] RunOn.. commands - Propagate errors in restart configurations (#2828) * RunOnX commands - Propagate errors in restart configurations * apply gofmt --------- Co-authored-by: James Bohnert Co-authored-by: aler9 <46489434+aler9@users.noreply.github.com> --- internal/externalcmd/cmd.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/internal/externalcmd/cmd.go b/internal/externalcmd/cmd.go index aed7f7d6..3e820abb 100644 --- a/internal/externalcmd/cmd.go +++ b/internal/externalcmd/cmd.go @@ -87,7 +87,11 @@ func (e *Cmd) run() { return } - e.onExit(fmt.Errorf("command exited with code 0")) + if err != nil { + e.onExit(err) + } else { + e.onExit(fmt.Errorf("command exited with code 0")) + } select { case <-time.After(restartPause):