From c217200b966f8dd99c27812d2aea0dad0a096a18 Mon Sep 17 00:00:00 2001 From: Jonathan Rudenberg Date: Thu, 28 Jul 2016 15:11:32 -0400 Subject: [PATCH] Return errors from InvokeHookScript instead of failing silently Signed-off-by: Jonathan Rudenberg --- helpers.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/helpers.go b/helpers.go index 5f10d35..c895a46 100644 --- a/helpers.go +++ b/helpers.go @@ -354,9 +354,9 @@ func (info *EntryInfo) InvokeHookScript(command string) error { cmd.Stderr = &stderrBuffer if err := cmd.Run(); err != nil { if _, isExitError := err.(*exec.ExitError); isExitError { - fmt.Errorf("Script failed: %s: %s", command, strings.TrimSpace(stderrBuffer.String())) + return fmt.Errorf("Script failed: %s: %s", command, strings.TrimSpace(stderrBuffer.String())) } else { - fmt.Errorf("Failed to execute script: %s: %s", command, err) + return fmt.Errorf("Failed to execute script: %s: %s", command, err) } } return nil