MCPcopy Create free account
hub / github.com/cortexproject/cortex / Add

Method Add

pkg/util/multierror/multierror.go:12–21  ·  view source on GitHub ↗

Add adds the error to the error list if it is not nil.

(err error)

Source from the content-addressed store, hash-verified

10
11// Add adds the error to the error list if it is not nil.
12func (es *MultiError) Add(err error) {
13 if err == nil {
14 return
15 }
16 if merr, ok := err.(nonNilMultiError); ok {
17 *es = append(*es, merr...)
18 } else {
19 *es = append(*es, err)
20 }
21}
22
23// Err returns the error list as an error or nil if it is empty.
24func (es MultiError) Err() error {

Callers 6

CloseMethod · 0.95
LoadRuleGroupsMethod · 0.95
TestMultiError_AddFunction · 0.95
NewFunction · 0.95
ForEachUserFunction · 0.95

Calls

no outgoing calls

Tested by 2

TestMultiError_AddFunction · 0.76