Skip to content

Commit d0412f3

Browse files
ttddyyjonatan-ivanov
authored andcommitted
Improve error message for reader and visitor
Closes gh-292 (cherry picked from commit d5b9778)
1 parent 92c2934 commit d0412f3

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

micrometer-docs-generator/src/main/java/io/micrometer/docs/commons/AbstractSearchingFileVisitor.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ protected void validateNameOrConvention(String name, @Nullable String convention
103103
if (StringUtils.hasText(name)) {
104104
if (conventionClassName != null) {
105105
throw new IllegalStateException(
106-
"You can't declare both [getName()] and [getDefaultConvention()] methods at the same time, you have to chose only one. Problem occurred in ["
106+
"You can't declare both [getName(),getContextualName()] and [getDefaultConvention()] methods at the same time, you have to chose only one. Problem occurred in ["
107107
+ enclosingEnum.getName() + "] class");
108108
}
109109
}

micrometer-docs-generator/src/main/java/io/micrometer/docs/commons/EventEntryForSpanEnumConstantReader.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,9 @@ public Class<?> getRequiredClass() {
3939
public EventEntry apply(EnumConstantSource enumConstantSource) {
4040
String description = AsciidocUtils.javadocToAsciidoc(enumConstantSource.getJavaDoc());
4141
String name = ParsingUtils.enumMethodValue(enumConstantSource, "getContextualName");
42-
Assert.notNull(name, "Event enum constants require readable getContextualName() for spans documentation.");
42+
Assert.notNull(name,
43+
String.format("Event enum constants require readable getContextualName() for spans documentation. [%s]",
44+
enumConstantSource.getName()));
4345

4446
EventEntry model = new EventEntry();
4547
model.setName(name);

0 commit comments

Comments
 (0)