Return errors from InvokeHookScript instead of failing silently

Signed-off-by: Jonathan Rudenberg <jonathan@titanous.com>
This commit is contained in:
Jonathan Rudenberg 2016-07-28 15:11:32 -04:00
parent 38b9c920eb
commit a67b9683cd
1 changed files with 2 additions and 2 deletions

View File

@ -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