Skip to content

Commit

Permalink
use errors.Is
Browse files Browse the repository at this point in the history
  • Loading branch information
dashpole committed Oct 23, 2023
1 parent 29787da commit fd16ce3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions exporters/prometheus/exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -148,11 +148,11 @@ func (c *collector) Collect(ch chan<- prometheus.Metric) {
metrics := metricdata.ResourceMetrics{}
err := c.reader.Collect(context.TODO(), &metrics)
if err != nil {
if err == metric.ErrReaderShutdown {
if errors.Is(err, metric.ErrReaderShutdown) {
return
}
otel.Handle(err)
if err == metric.ErrReaderNotRegistered {
if errors.Is(err, metric.ErrReaderNotRegistered) {

Check warning on line 155 in exporters/prometheus/exporter.go

View check run for this annotation

Codecov / codecov/patch

exporters/prometheus/exporter.go#L155

Added line #L155 was not covered by tests
return
}
}
Expand Down

0 comments on commit fd16ce3

Please sign in to comment.