diff --git a/main/main.go b/main/main.go index 365269e..c32dab1 100644 --- a/main/main.go +++ b/main/main.go @@ -62,6 +62,7 @@ func main() { res, err := sensuExecutor.Execute(req) if err != nil { //TODO: log warning + continue } results <- res default: diff --git a/sensu/executor.go b/sensu/executor.go index 2e4cded..362d497 100644 --- a/sensu/executor.go +++ b/sensu/executor.go @@ -63,11 +63,11 @@ func (self *Executor) Execute(request CheckRequest) (Result, error) { if _, ok := self.scriptCache[request.Command]; !ok { scriptFile, err := ioutil.TempFile(self.TmpBaseDir, "check-") if err != nil { - return Result{}, err + return Result{}, fmt.Errorf("Failed to create temporary file for script: %s", err) } _, err = scriptFile.Write([]byte(fmt.Sprintf("#!/usr/bin/env sh\n%s\n", request.Command))) if err != nil { - return Result{}, err + return Result{}, fmt.Errorf("Failed to write script content to temporary file: %s", err) } self.scriptCache[request.Command] = scriptFile.Name() scriptFile.Close()