Skip to content

Commit

Permalink
Merge pull request #36181 from geoand/RestMulti-error-message
Browse files Browse the repository at this point in the history
Mention RestMulti in error message for dynamic media type in Multi
  • Loading branch information
geoand authored Sep 28, 2023
2 parents d4e12e4 + a7a6919 commit ff64a75
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -308,14 +308,14 @@ public void handle(ResteasyReactiveRequestContext requestContext) throws Excepti
produces = REST_MULTI_DEFAULT_SERVER_MEDIA_TYPE;
} else {
throw new IllegalStateException(
"Negotiation or dynamic media type not supported yet for Multi: please use the @Produces annotation when returning a Multi");
"Negotiation or dynamic media type resolution for Multi is only supported when using 'org.jboss.resteasy.reactive.RestMulti'");
}

}
MediaType[] mediaTypes = produces.getSortedOriginalMediaTypes();
if (mediaTypes.length != 1) {
throw new IllegalStateException(
"Negotiation or dynamic media type not supported yet for Multi: please use a single @Produces annotation");
"Negotiation or dynamic media type resolution for Multi is only supported when using 'org.jboss.resteasy.reactive.RestMulti'");
}

MediaType mediaType = mediaTypes[0];
Expand Down

0 comments on commit ff64a75

Please sign in to comment.