ensure cancel error registered

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

@ -221,7 +221,10 @@ func (e *Execer) exec(ctx context.Context, state *pipeline.State, spec Spec, ste
result = multierror.Append(result, err)
}
switch err {
// if the context was cancelled and returns a Canceled or
// DeadlineExceeded error this indicates the pipeline was
// cancelled.
switch ctx.Err() {
case context.Canceled, context.DeadlineExceeded:
state.Cancel()
return nil
@ -242,6 +245,12 @@ 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