Skip to content

Commit 57ef0f7

Browse files
authored
clearer error msg (#561)
* clearer error msg * another clearer msg
1 parent 371fc7f commit 57ef0f7

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

pkg/utils/validators.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ func IsValidMetricName(name string) error {
2222
}
2323

2424
if !metricNameValidationRegex.Match([]byte(trimmed)) {
25-
return fmt.Errorf("metric name contains illegal characters. Name should conform to '%s'",
26-
metricNameValidationRegexStr)
25+
return fmt.Errorf("metric name contains illegal characters. Name '%s' should conform to '%s'",
26+
trimmed, metricNameValidationRegexStr)
2727
}
2828

2929
return nil
@@ -36,8 +36,8 @@ func IsValidLabelName(labelName string) error {
3636
}
3737

3838
if !labelValidationRegex.Match([]byte(trimmed)) {
39-
return fmt.Errorf("label name contains illegal characters. Label name should conform to '%s'",
40-
labelValidationRegexStr)
39+
return fmt.Errorf("label name contains illegal characters. Label name '%s' should conform to '%s'",
40+
trimmed, labelValidationRegexStr)
4141
}
4242

4343
return nil

0 commit comments

Comments
 (0)