ensure cancel error registered

pull/5/head
Brad Rydzewski 4 years ago
parent fcb3f98de0
commit e567c860a8

@ -221,6 +221,12 @@ func (e *Execer) exec(ctx context.Context, state *pipeline.State, spec Spec, ste
result = multierror.Append(result, err)
}
switch err {
case context.Canceled, context.DeadlineExceeded:
state.Cancel()
return nil
}
if exited != nil {
state.Finish(step.GetName(), exited.ExitCode)
err := e.reporter.ReportStep(noContext, state, step.GetName())
@ -236,12 +242,6 @@ func (e *Execer) exec(ctx context.Context, state *pipeline.State, spec Spec, ste
return result
}
switch err {
case context.Canceled, context.DeadlineExceeded:
state.Cancel()
return nil
}
// if the step failed with an internal error (as opposed to a
// runtime error) the step is failed.
state.Fail(step.GetName(), err)

Loading…
Cancel
Save