Skip to content

Commit

Permalink
fix: include stdout and stderr in all Exec returns.
Browse files Browse the repository at this point in the history
  • Loading branch information
John Montroy committed May 5, 2021
1 parent 4dfbac7 commit 6e8ced1
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 6e8ced1

Please sign in to comment.