Skip to content

Commit

Permalink
Log errors non-fatally in ExecBee
Browse files Browse the repository at this point in the history
  • Loading branch information
muesli committed Feb 22, 2020
1 parent 0fa9f80 commit 8eb5a35
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions bees/execbee/execbee.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ func (mod *ExecBee) Action(action bees.Action) []bees.Placeholder {
stdinPipe, err := cmd.StdinPipe()

if err != nil {
mod.LogFatal("Error creating stdinPipe for Cmd", err)
mod.LogErrorf("Error creating stdinPipe for Cmd: %v", err)
return
}

Expand All @@ -74,7 +74,7 @@ func (mod *ExecBee) Action(action bees.Action) []bees.Placeholder {
// read and print stdout
outReader, err := cmd.StdoutPipe()
if err != nil {
mod.LogFatal("Error creating StdoutPipe for Cmd", err)
mod.LogErrorf("Error creating StdoutPipe for Cmd: %v", err)
return
}
outBuffer := []string{}
Expand All @@ -90,7 +90,7 @@ func (mod *ExecBee) Action(action bees.Action) []bees.Placeholder {
// read and print stderr
errReader, err := cmd.StderrPipe()
if err != nil {
mod.LogFatal("Error creating StderrPipe for Cmd", err)
mod.LogErrorf("Error creating StderrPipe for Cmd: %v", err)
return
}
errBuffer := []string{}
Expand All @@ -105,12 +105,12 @@ func (mod *ExecBee) Action(action bees.Action) []bees.Placeholder {

err = cmd.Start()
if err != nil {
mod.LogFatal("Error starting Cmd", err)
mod.LogErrorf("Error starting Cmd: %v", err)
}

err = cmd.Wait()
if err != nil {
mod.LogFatal("Error waiting for Cmd", err)
mod.LogErrorf("Error waiting for Cmd: %v", err)
}

ev := bees.Event{
Expand Down

0 comments on commit 8eb5a35

Please sign in to comment.