Alerting: Don't suppress translation errors in PointsFromFrames (#93747)

* don't suppress error

* reorder

* re-add nilcheck
This commit is contained in:
Alexander Weaver 2024-09-26 16:30:50 -05:00 committed by GitHub
parent acb051b314
commit 378d92130d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -66,9 +66,15 @@ func PointsFromFrames(name string, t time.Time, frames data.Frames, extraLabels
points := make([]Point, 0, len(col.Refs))
for _, ref := range col.Refs {
fp, empty, _ := ref.NullableFloat64Value()
if empty || fp == nil {
return nil, fmt.Errorf("unable to read float64 value")
fp, empty, err := ref.NullableFloat64Value()
if err != nil {
return nil, fmt.Errorf("unable to read float64 value: %w", err)
}
if empty {
return nil, fmt.Errorf("empty frame")
}
if fp == nil {
return nil, fmt.Errorf("nil frame")
}
metric := Metric{