Skip to content

Commit e11e3f8

Browse files
authored
Merge pull request #7241 from Channyboy/1792-unclearErrorMessageMpMetrics
1792 unclear error message mp metrics
2 parents 91cb55e + d961406 commit e11e3f8

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

dev/com.ibm.ws.microprofile.metrics/src/com/ibm/ws/microprofile/metrics/impl/MetricRegistryImpl.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*******************************************************************************
2-
* Copyright (c) 2017, 2018 IBM Corporation and others.
2+
* Copyright (c) 2017, 2019 IBM Corporation and others.
33
*
44
* All rights reserved. This program and the accompanying materials
55
* are made available under the terms of the Eclipse Public License v1.0
@@ -443,7 +443,9 @@ private <T extends Metric> T getOrAdd(Metadata metadata, MetricBuilder<T> builde
443443
}
444444
}
445445
}
446-
throw new IllegalArgumentException(metadata.getName() + " is already used for a different type of metric");
446+
throw new IllegalArgumentException(metadata.getName() + " is already used for a different type of metric. "
447+
+ "A metric name can only be used with one type of metric. Ensure that " + metadata.getName()
448+
+ " is used with only one type of metric.");
447449
}
448450

449451
@SuppressWarnings("unchecked")

0 commit comments

Comments
 (0)