Skip to content

Commit

Permalink
Rename error.
Browse files Browse the repository at this point in the history
  • Loading branch information
StevenYCChou committed Mar 12, 2019
1 parent caae5cd commit 7786bc0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions retrieval/series_cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ var (
keyReason, _ = tag.NewKey("reason")
)

type unrecoverableError struct {
type unknownMetricError struct {
error
}

Expand Down Expand Up @@ -426,14 +426,14 @@ func (c *seriesCache) refresh(ctx context.Context, ref uint64) error {
ts.MetricKind = metric_pb.MetricDescriptor_GAUGE
ts.ValueType = metric_pb.MetricDescriptor_DOUBLE
default:
return unrecoverableError{errors.Errorf("unexpected metric name suffix %q", suffix)}
return unknownMetricError{errors.Errorf("unexpected metric name suffix %q", suffix)}
}
case textparse.MetricTypeHistogram:
ts.Metric.Type = c.getMetricType(c.metricsPrefix, baseMetricName)
ts.MetricKind = metric_pb.MetricDescriptor_CUMULATIVE
ts.ValueType = metric_pb.MetricDescriptor_DISTRIBUTION
default:
return unrecoverableError{errors.Errorf("unexpected metric type %s", metadata.Type)}
return unknownMetricError{errors.Errorf("unexpected metric type %s", metadata.Type)}
}

entry.proto = ts
Expand Down
2 changes: 1 addition & 1 deletion retrieval/transform.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ func (b *sampleBuilder) getSeriesWithRetry(ctx context.Context, sample tsdb.RefS
if err == nil {
break
}
if _, ok := err.(unrecoverableError); ok {
if _, ok := err.(unknownMetricError); ok {
return nil, false, err
}
level.Warn(b.logger).Log("msg", "failed to get seriesCacheEntry", "err", err)
Expand Down

0 comments on commit 7786bc0

Please sign in to comment.