Skip to content

Commit

Permalink
Add RunContextE
Browse files Browse the repository at this point in the history
Add RunContextE function like RunContext, but returns an error rather
than logging a fatal error.
  • Loading branch information
cwarden committed Aug 27, 2024
1 parent 6bdd7de commit 265aa13
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions execution.go
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,11 @@ func (e *Execution) RunContext(ctx context.Context) force.JobInfo {
return job
}

func (e *Execution) RunContextE(ctx context.Context) (force.JobInfo, error) {
job, err := e.ExecuteContext(ctx)
return job, err
}

func (e *Execution) Run() force.JobInfo {
return e.RunContext(context.Background())
}
Expand Down

0 comments on commit 265aa13

Please sign in to comment.