From 5e6900558a80ce5de078f5a65a0778a828a40f2c Mon Sep 17 00:00:00 2001 From: George Krajcsovits Date: Fri, 19 Sep 2025 08:58:27 +0200 Subject: [PATCH] Apply suggestions from code review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Björn Rabenstein Signed-off-by: George Krajcsovits --- model/histogram/generic.go | 2 +- storage/remote/codec.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/model/histogram/generic.go b/model/histogram/generic.go index b5aa19f9cb..cc1fbce685 100644 --- a/model/histogram/generic.go +++ b/model/histogram/generic.go @@ -39,7 +39,7 @@ var ( ErrHistogramCustomBucketsInfinite = errors.New("histogram custom bounds must be finite") ErrHistogramsIncompatibleSchema = errors.New("cannot apply this operation on histograms with a mix of exponential and custom bucket schemas") ErrHistogramsIncompatibleBounds = errors.New("cannot apply this operation on custom buckets histograms with different custom bounds") - ErrHistogramsInvalidSchema = errors.New("histogram has an invalid schema, which must be between -4 and 8 for exponential buckets, or -53 for custom buckets") + ErrHistogramsInvalidSchema = fmt.Errorf("histogram has an invalid schema, which must be between %d and %d for exponential buckets, or %d for custom buckets", ExponentialSchemaMin, ExponentialSchemaMax, CustomBucketsSchema) ) func IsCustomBucketsSchema(s int32) bool { diff --git a/storage/remote/codec.go b/storage/remote/codec.go index 2042e12199..87b7ff2290 100644 --- a/storage/remote/codec.go +++ b/storage/remote/codec.go @@ -475,7 +475,7 @@ func validateHistogramSchema(h *prompb.Histogram) error { if histogram.IsValidSchema(h.Schema) { return nil } - return fmt.Errorf("invalid histogram schema %d", h.Schema) + return return fmt.Errorf("%w, got schema %d", h.Schema, histogram.ErrHistogramsInvalidSchema) } func getHistogramValType(h *prompb.Histogram) chunkenc.ValueType {