Skip to content

Commit

Permalink
Merge pull request #36910 from geoand/#36798
Browse files Browse the repository at this point in the history
Use proper exception when media type handling is incorrect
  • Loading branch information
geoand authored Nov 7, 2023
2 parents 704a50f + 84cd0ae commit 778123a
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import java.util.List;
import java.util.Map;

import jakarta.ws.rs.NotSupportedException;
import jakarta.ws.rs.WebApplicationException;
import jakarta.ws.rs.core.HttpHeaders;
import jakarta.ws.rs.core.MediaType;
Expand Down Expand Up @@ -73,7 +74,7 @@ public void handle(ResteasyReactiveRequestContext requestContext) throws Excepti
selectedHolder = resourcesByConsumes.get(MediaType.WILDCARD_TYPE);
}
if (selectedHolder == null) {
throw new WebApplicationException(Response.status(Response.Status.UNSUPPORTED_MEDIA_TYPE).build());
throw new NotSupportedException("The content-type header value did not match the value in @Consumes");
}
RuntimeResource selectedResource;
if (selectedHolder.mtWithoutParamsToResource.size() == 1) {
Expand Down

0 comments on commit 778123a

Please sign in to comment.