Skip to content

Commit

Permalink
fix(scheme/exec): make sure do not add exit_code if timed out on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
macrat committed May 30, 2022
1 parent 93dea1a commit b6d98ba
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion internal/scheme/exec.go
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,9 @@ func (s ExecScheme) run(ctx context.Context, r Reporter, extraEnv []string) {
extra = map[string]interface{}{"exit_code": 0}
} else {
var exitErr *exec.ExitError
if errors.As(err, &exitErr) && exitErr.ExitCode() >= 0 {
if ctx.Err() == context.DeadlineExceeded || ctx.Err() == context.Canceled {
// do not add exit_code if command cancelled by Ayd.
} else if errors.As(err, &exitErr) && exitErr.ExitCode() >= 0 {
extra = map[string]interface{}{"exit_code": exitErr.ExitCode()}
}
}
Expand Down

0 comments on commit b6d98ba

Please sign in to comment.