MCPcopy Create free account
hub / github.com/github/gh-aw / Add

Method Add

pkg/workflow/workflow_errors.go:224–242  ·  view source on GitHub ↗

Add adds an error to the collector If failFast is enabled, returns the error immediately Otherwise, adds it to the collection and returns nil

(err error)

Source from the content-addressed store, hash-verified

222// If failFast is enabled, returns the error immediately
223// Otherwise, adds it to the collection and returns nil
224func (c *ErrorCollector) Add(err error) error {
225 if err == nil {
226 return nil
227 }
228
229 if errorAggregationLog.Enabled() {
230 errorAggregationLog.Printf("Adding error to collector: %v", err)
231 }
232
233 if c.failFast {
234 if errorAggregationLog.Enabled() {
235 errorAggregationLog.Print("Fail-fast enabled, returning error immediately")
236 }
237 return err
238 }
239
240 c.errors = append(c.errors, err)
241 return nil
242}
243
244// Count returns the number of errors collected
245func (c *ErrorCollector) Count() int {

Calls 3

PrintMethod · 0.80
EnabledMethod · 0.45
PrintfMethod · 0.45