Skip to content

Commit 027c2bf

Browse files
author
Yen-Cheng Chou
committed
Rename error.
1 parent a324a33 commit 027c2bf

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

retrieval/series_cache.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ var (
4343
keyReason, _ = tag.NewKey("reason")
4444
)
4545

46-
type unrecoverableError struct {
46+
type unknownMetricError struct {
4747
error
4848
}
4949

@@ -451,14 +451,14 @@ func (c *seriesCache) refresh(ctx context.Context, ref uint64) error {
451451
ts.MetricKind = metric_pb.MetricDescriptor_GAUGE
452452
ts.ValueType = metric_pb.MetricDescriptor_DOUBLE
453453
default:
454-
return unrecoverableError{errors.Errorf("unexpected metric name suffix %q", suffix)}
454+
return unknownMetricError{errors.Errorf("unexpected metric name suffix %q", suffix)}
455455
}
456456
case textparse.MetricTypeHistogram:
457457
ts.Metric.Type = c.getMetricType(c.metricsPrefix, baseMetricName)
458458
ts.MetricKind = metric_pb.MetricDescriptor_CUMULATIVE
459459
ts.ValueType = metric_pb.MetricDescriptor_DISTRIBUTION
460460
default:
461-
return unrecoverableError{errors.Errorf("unexpected metric type %s", metadata.Type)}
461+
return unknownMetricError{errors.Errorf("unexpected metric type %s", metadata.Type)}
462462
}
463463

464464
entry.proto = ts

retrieval/transform.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ func (b *sampleBuilder) getSeriesWithRetry(ctx context.Context, sample tsdb.RefS
143143
if err == nil {
144144
break
145145
}
146-
if _, ok := err.(unrecoverableError); ok {
146+
if _, ok := err.(unknownMetricError); ok {
147147
return nil, false, err
148148
}
149149
level.Warn(b.logger).Log("msg", "failed to get seriesCacheEntry", "err", err)

0 commit comments

Comments
 (0)