MCPcopy
hub / github.com/grafana/dskit / Add

Method Add

multierror/multierror.go:15–24  ·  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

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

Callers 6

ResolveMethod · 0.95
NewFunction · 0.95
ForEachUserFunction · 0.95
CloseWithErrCaptureFunction · 0.95
DeleteAllFunction · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected