Skip to content

Commit

Permalink
Fixed: Return the error when a command fails to start (#855)
Browse files Browse the repository at this point in the history
  • Loading branch information
aelsabbahy authored Nov 10, 2023
1 parent 10b895d commit a807f94
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions util/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,14 @@ func (c *Command) Run() error {

if err := c.Cmd.Start(); err != nil {
c.Err = err
//log.Fatalf("Cmd.Start: %v")
return c.Err
}

if err := c.Cmd.Wait(); err != nil {
c.Err = err
if exiterr, ok := err.(*exec.ExitError); ok {
if status, ok := exiterr.Sys().(syscall.WaitStatus); ok {
c.Status = status.ExitStatus()
//log.Printf("Exit Status: %d", status.ExitStatus())
}
}
} else {
Expand Down

0 comments on commit a807f94

Please sign in to comment.