Skip to content

Commit

Permalink
Merge pull request #608 from Praqma/john/always-include-stdout-stderr
Browse files Browse the repository at this point in the history
fix: include stdout and stderr in all Exec returns.
  • Loading branch information
luisdavim authored May 6, 2021
2 parents 773d1b0 + 6e8ced1 commit 7fa4070
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions internal/app/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,11 +102,10 @@ func (c *Command) Exec() (ExitStatus, error) {
}
if err != nil {
res.code = 1
err = fmt.Errorf("failed to run %s: %w", c.Description, err)
if exiterr, ok := err.(*exec.ExitError); ok {
res.code = exiterr.ExitCode()
err = c.newExitError(exiterr.ExitCode(), stdout, stderr, err)
}
err = c.newExitError(res.code, stdout, stderr, err)
}
return res, err
}
Expand Down

0 comments on commit 7fa4070

Please sign in to comment.