Skip to content

Commit

Permalink
Fix TestFromMetrics error comparison
Browse files Browse the repository at this point in the history
Signed-off-by: Saswata Mukherjee <[email protected]>
  • Loading branch information
saswatamcode committed Jan 15, 2025
1 parent e1b435a commit f74fe86
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions pkg/errutil/multierror.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,15 @@ func (es NonNilMultiError) Cause() error {
return es.getCause()
}

func (es NonNilMultiError) Is(target error) bool {
for _, err := range es {
if errors.Is(err, target) {
return true
}
}
return false
}

func (es NonNilMultiError) getCause() NonNilMultiRootError {
var causes []error
for _, err := range es {
Expand Down

0 comments on commit f74fe86

Please sign in to comment.