From a2cf34e2b46268455b0224d062419bc091dc5f9c Mon Sep 17 00:00:00 2001 From: Tristan Partin Date: Fri, 9 Aug 2024 17:50:07 -0500 Subject: log: explain why the signature command failed It wasn't previously apparent why the command failed. Signed-off-by: Tristan Partin Acked-by: Robin Jarry --- lib/state/templates.go | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'lib') diff --git a/lib/state/templates.go b/lib/state/templates.go index c7bfad8c..390ab131 100644 --- a/lib/state/templates.go +++ b/lib/state/templates.go @@ -3,6 +3,7 @@ package state import ( "bufio" "bytes" + "errors" "fmt" "os" "os/exec" @@ -698,6 +699,10 @@ func (d *templateData) Signature() string { var err error signature, err = d.readSignatureFromCmd() if err != nil { + var execErr *exec.ExitError + if errors.As(err, &execErr) { + log.Warnf("signature command failed with error (%d): %s", execErr.ExitCode(), execErr.Stderr) + } signature = d.readSignatureFromFile() } } else { -- cgit