Skip to content

Commit e324325

Browse files
committed
fix(server): improve error handling for histogram buckets parsing
Signed-off-by: Clément Nussbaumer <clement.nussbaumer@postfinance.ch>
1 parent ee0ad5e commit e324325

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

internal/kubenurse/server.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -119,11 +119,11 @@ func New(ctx context.Context, c client.Client) (*Server, error) { //nolint:funle
119119

120120
if bucketsString := os.Getenv("KUBENURSE_HISTOGRAM_BUCKETS"); bucketsString != "" {
121121
for _, bucketStr := range strings.Split(bucketsString, ",") {
122-
bucket, e := strconv.ParseFloat(bucketStr, 64)
122+
bucket, err := strconv.ParseFloat(bucketStr, 64)
123123

124-
if e != nil {
125-
slog.Error("couldn't parse one of the custom histogram buckets", "bucket", bucket, "err", e)
126-
return nil, e
124+
if err != nil {
125+
slog.Error("couldn't parse one of the custom histogram buckets", "bucket", bucket, "err", err)
126+
os.Exit(1)
127127
}
128128

129129
histogramBuckets = append(histogramBuckets, bucket)

0 commit comments

Comments
 (0)