15
15
package consumererror // import "go.opentelemetry.io/collector/consumer/consumererror"
16
16
17
17
import (
18
- "errors"
19
-
20
18
"go.opentelemetry.io/collector/model/pdata"
21
19
)
22
20
@@ -35,16 +33,6 @@ func NewTraces(err error, failed pdata.Traces) error {
35
33
}
36
34
}
37
35
38
- // AsTraces finds the first error in err's chain that can be assigned to target. If such an error is found,
39
- // it is assigned to target and true is returned, otherwise false is returned.
40
- // Deprecated: Use `errors.As(err, target)` instead.
41
- func AsTraces (err error , target * Traces ) bool {
42
- if err == nil {
43
- return false
44
- }
45
- return errors .As (err , target )
46
- }
47
-
48
36
// GetTraces returns failed traces from the associated error.
49
37
func (err Traces ) GetTraces () pdata.Traces {
50
38
return err .failed
@@ -70,16 +58,6 @@ func NewLogs(err error, failed pdata.Logs) error {
70
58
}
71
59
}
72
60
73
- // AsLogs finds the first error in err's chain that can be assigned to target. If such an error is found,
74
- // it is assigned to target and true is returned, otherwise false is returned.
75
- // Deprecated: Use `errors.As(err, target)` instead.
76
- func AsLogs (err error , target * Logs ) bool {
77
- if err == nil {
78
- return false
79
- }
80
- return errors .As (err , target )
81
- }
82
-
83
61
// GetLogs returns failed logs from the associated error.
84
62
func (err Logs ) GetLogs () pdata.Logs {
85
63
return err .failed
@@ -105,16 +83,6 @@ func NewMetrics(err error, failed pdata.Metrics) error {
105
83
}
106
84
}
107
85
108
- // AsMetrics finds the first error in err's chain that can be assigned to target. If such an error is found,
109
- // it is assigned to target and true is returned, otherwise false is returned.
110
- // Deprecated: Use `errors.As(err, target)` instead.
111
- func AsMetrics (err error , target * Metrics ) bool {
112
- if err == nil {
113
- return false
114
- }
115
- return errors .As (err , target )
116
- }
117
-
118
86
// GetMetrics returns failed metrics from the associated error.
119
87
func (err Metrics ) GetMetrics () pdata.Metrics {
120
88
return err .failed
0 commit comments