From 485d812785b842483075b10b7293c4a6c817f1cb Mon Sep 17 00:00:00 2001 From: Georgios Andrianakis Date: Wed, 27 Sep 2023 18:20:13 +0300 Subject: [PATCH] Mention RestMulti in error message for dynamic media type in Multi --- .../reactive/server/handlers/PublisherResponseHandler.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/independent-projects/resteasy-reactive/server/runtime/src/main/java/org/jboss/resteasy/reactive/server/handlers/PublisherResponseHandler.java b/independent-projects/resteasy-reactive/server/runtime/src/main/java/org/jboss/resteasy/reactive/server/handlers/PublisherResponseHandler.java index a6aa28fd1e6326..4d097feaad8743 100644 --- a/independent-projects/resteasy-reactive/server/runtime/src/main/java/org/jboss/resteasy/reactive/server/handlers/PublisherResponseHandler.java +++ b/independent-projects/resteasy-reactive/server/runtime/src/main/java/org/jboss/resteasy/reactive/server/handlers/PublisherResponseHandler.java @@ -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];