Skip to content

Commit

Permalink
Improve error message for reader and visitor
Browse files Browse the repository at this point in the history
Closes gh-292

(cherry picked from commit d5b9778)
  • Loading branch information
ttddyy authored and jonatan-ivanov committed Sep 6, 2024
1 parent 92c2934 commit d0412f3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ protected void validateNameOrConvention(String name, @Nullable String convention
if (StringUtils.hasText(name)) {
if (conventionClassName != null) {
throw new IllegalStateException(
"You can't declare both [getName()] and [getDefaultConvention()] methods at the same time, you have to chose only one. Problem occurred in ["
"You can't declare both [getName(),getContextualName()] and [getDefaultConvention()] methods at the same time, you have to chose only one. Problem occurred in ["
+ enclosingEnum.getName() + "] class");
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@ public Class<?> getRequiredClass() {
public EventEntry apply(EnumConstantSource enumConstantSource) {
String description = AsciidocUtils.javadocToAsciidoc(enumConstantSource.getJavaDoc());
String name = ParsingUtils.enumMethodValue(enumConstantSource, "getContextualName");
Assert.notNull(name, "Event enum constants require readable getContextualName() for spans documentation.");
Assert.notNull(name,
String.format("Event enum constants require readable getContextualName() for spans documentation. [%s]",
enumConstantSource.getName()));

EventEntry model = new EventEntry();
model.setName(name);
Expand Down

0 comments on commit d0412f3

Please sign in to comment.