mirror of
https://github.com/coredns/coredns.git
synced 2026-05-26 11:50:24 -04:00
lint(errorlint): handle wrapped errors
Enable errorlint and preserve wrapped error chains so runtime checks and tests classify failures correctly. This also makes Route53 surface insert failures instead of silently dropping them. Signed-off-by: Ville Vesilehto <ville@vesilehto.fi>
This commit is contained in:
@@ -110,7 +110,7 @@ func getBucketCount(mf *test.MetricFamily, bucketLabel string) (int, error) {
|
||||
|
||||
count, err := strconv.Atoi(countStr)
|
||||
if err != nil {
|
||||
return 0, fmt.Errorf("could not parse bucket count '%s' for %s: %v", countStr, mf.Name, err)
|
||||
return 0, fmt.Errorf("could not parse bucket count %q for %s: %w", countStr, mf.Name, err)
|
||||
}
|
||||
return count, nil
|
||||
}
|
||||
@@ -126,11 +126,11 @@ func extractRequestSizeBucketCounts(t *testing.T, metrics []*test.MetricFamily,
|
||||
t.Logf(" %s: %v", mf.Name, mf.Metrics)
|
||||
countBelow100, err = getBucketCount(mf, "100")
|
||||
if err != nil {
|
||||
return 0, 0, fmt.Errorf("%s: error getting bucket count for 100: %v", label, err)
|
||||
return 0, 0, fmt.Errorf("%s: error getting bucket count for 100: %w", label, err)
|
||||
}
|
||||
countAbove100, err = getBucketCount(mf, "1023")
|
||||
if err != nil {
|
||||
return 0, 0, fmt.Errorf("%s: error getting bucket count for 1023: %v", label, err)
|
||||
return 0, 0, fmt.Errorf("%s: error getting bucket count for 1023: %w", label, err)
|
||||
}
|
||||
return countBelow100, countAbove100, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user