func (nodule *Nodule) handleCommon(process string, args []string) (err os.Error) { exe, err := exec.LookPath(args[0]) if err != nil { return nodule.Error(process, err) } cmd := &exec.Cmd{ Path: exe, Args: args, Dir: nodule.Path, } output, err := cmd.CombinedOutput() if err != nil { logging.ErrorData("node", fmt.Errorf("Error running %v: %s", args, err)) logging.ErrorData("node", "\n\n"+string(output)) return } return }
func (nodule *Nodule) Error(process string, error os.Error) os.Error { logging.ErrorData( "node", fmt.Sprintf("Error %s the %s nodule: %s", process, nodule.Name, error)) return error }