Skip to content

Commit

Permalink
Merge pull request #19851 from michalszynkiewicz/subresource-return
Browse files Browse the repository at this point in the history
Rest Client Reactive: improve error on invalid subresource return type
  • Loading branch information
geoand authored Sep 2, 2021
2 parents 006d2ec + 0b18024 commit 7e86d2e
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -505,7 +505,11 @@ A more full example of generated client (with sub-resource) can is at the bottom
ClassInfo subResourceInterface = index.getClassByName(returnType.name());
if (!Modifier.isInterface(subResourceInterface.flags())) {
throw new IllegalArgumentException(
"Sub resource type is not an interface: " + returnType.name().toString());
"Client interface method: " + jandexMethod.declaringClass().name() + "#" + jandexMethod
+ " has no HTTP method annotation (@GET, @POST, etc) and it's return type: "
+ returnType.name().toString() + " is not an interface. "
+ "If it's a sub resource method, it has to return an interface. "
+ "If it's not, it has to have one of the HTTP method annotations.");
}
// generate implementation for a method from the jaxrs interface:
MethodCreator methodCreator = c.getMethodCreator(method.getName(), method.getSimpleReturnType(),
Expand Down

0 comments on commit 7e86d2e

Please sign in to comment.