DropWizardMetricMaker: Improve error message when metric name is invalid
In case the metric name is invalid, the stack trace only contains the required pattern but not the name itself. Add the metric name to the message so that the stack trace is more informative. Change-Id: If1750a46e7d1e513d3d372212b8a95c89f682da0 Signed-off-by: Eryk Szymanski <eryksz@gmail.com>
This commit is contained in:
committed by
David Pursehouse
parent
0d9927c858
commit
594a4632e3
@@ -339,7 +339,8 @@ public class DropWizardMetricMaker extends MetricMaker {
|
||||
private static void checkMetricName(String name) {
|
||||
checkArgument(
|
||||
METRIC_NAME_PATTERN.matcher(name).matches(),
|
||||
"metric name must match %s",
|
||||
"invalid metric name '%s': must match pattern '%s'",
|
||||
name,
|
||||
METRIC_NAME_PATTERN.pattern());
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user