File tree Expand file tree Collapse file tree 3 files changed +1
-97
lines changed
Expand file tree Collapse file tree 3 files changed +1
-97
lines changed Original file line number Diff line number Diff line change @@ -18,8 +18,6 @@ package componenterror
1818
1919import (
2020 "errors"
21- "fmt"
22- "strings"
2321
2422 "go.opentelemetry.io/collector/consumer/consumererror"
2523)
3836// CombineErrors converts a list of errors into one error.
3937// Deprecated: use consumererror.CombineErrors instead.
4038func CombineErrors (errs []error ) error {
41- numErrors := len (errs )
42- if numErrors == 0 {
43- // No errors
44- return nil
45- }
46-
47- if numErrors == 1 {
48- return errs [0 ]
49- }
50-
51- errMsgs := make ([]string , 0 , numErrors )
52- permanent := false
53- for _ , err := range errs {
54- if ! permanent && consumererror .IsPermanent (err ) {
55- permanent = true
56- }
57- errMsgs = append (errMsgs , err .Error ())
58- }
59- err := fmt .Errorf ("[%s]" , strings .Join (errMsgs , "; " ))
60- if permanent {
61- err = consumererror .Permanent (err )
62- }
63- return err
39+ return consumererror .CombineErrors (errs )
6440}
Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -20,8 +20,6 @@ import (
2020)
2121
2222// CombineErrors converts a list of errors into one error.
23- //
24- // TODO: deprecate componenterror.CombineErrors in favor of this function.
2523func CombineErrors (errs []error ) error {
2624 numErrors := len (errs )
2725 if numErrors == 0 {
You can’t perform that action at this time.
0 commit comments