@@ -8,11 +8,11 @@ import (
88type (
99 // Pipeline holds and runs intermediate actions, called "steps".
1010 Pipeline struct {
11- steps []Step
12- context Context
13- beforeHooks []Listener
14- finalizer ResultHandler
15- disableErrorWrapping bool
11+ steps []Step
12+ context Context
13+ beforeHooks []Listener
14+ finalizer ResultHandler
15+ options options
1616 }
1717 // Result is the object that is returned after each step and after running a pipeline.
1818 Result struct {
@@ -91,7 +91,7 @@ func (p *Pipeline) WithSteps(steps ...Step) *Pipeline {
9191// WithNestedSteps is similar to AsNestedStep, but it accepts the steps given directly as parameters.
9292func (p * Pipeline ) WithNestedSteps (name string , steps ... Step ) Step {
9393 return NewStep (name , func (_ Context ) Result {
94- nested := & Pipeline {beforeHooks : p .beforeHooks , steps : steps , context : p .context , disableErrorWrapping : p .disableErrorWrapping }
94+ nested := & Pipeline {beforeHooks : p .beforeHooks , steps : steps , context : p .context , options : p .options }
9595 return nested .Run ()
9696 })
9797}
@@ -100,7 +100,7 @@ func (p *Pipeline) WithNestedSteps(name string, steps ...Step) Step {
100100// The properties are passed to the nested pipeline.
101101func (p * Pipeline ) AsNestedStep (name string ) Step {
102102 return NewStep (name , func (_ Context ) Result {
103- nested := & Pipeline {beforeHooks : p .beforeHooks , steps : p .steps , context : p .context }
103+ nested := & Pipeline {beforeHooks : p .beforeHooks , steps : p .steps , context : p .context , options : p . options }
104104 return nested .Run ()
105105 })
106106}
@@ -149,7 +149,7 @@ func (p *Pipeline) doRun() Result {
149149 // Abort pipeline without error
150150 return Result {aborted : true }
151151 }
152- if p .disableErrorWrapping {
152+ if p .options . disableErrorWrapping {
153153 return Result {Err : err }
154154 }
155155 return Result {Err : fmt .Errorf ("step '%s' failed: %w" , step .Name , err )}
0 commit comments