Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resteasy microprofile client does not create specific WebApplicationException #373

Open
chonton opened this issue Sep 21, 2024 · 1 comment · May be fixed by #374
Open

Resteasy microprofile client does not create specific WebApplicationException #373

chonton opened this issue Sep 21, 2024 · 1 comment · May be fixed by #374

Comments

@chonton
Copy link

chonton commented Sep 21, 2024

The bug
When a rest api returns a 4xx or 5xx status code, Resteasy microprofile client creates a generic WebApplicationException.
I must register the following ResponseExceptionMapper to get the expected behavior.

Expected behavior
Produce a specific WebApplicationException such as ForbiddenException for 403 or NotFoundException for 404. This is the behavior of classic Resteasy client.

Actual behavior
Resteasy microprofile client creates a generic WebApplicationException with the correct status code.

How to Reproduce?
Invoke any web service that returns a 4xx or 5xx status code

This is root cause of quarkus #23951

chonton added a commit to chonton/resteasy-microprofile that referenced this issue Sep 21, 2024
chonton added a commit to chonton/resteasy-microprofile that referenced this issue Sep 22, 2024
@jamezp
Copy link
Contributor

jamezp commented Sep 23, 2024

I'll think about this more, but I guess it depends on how you interpret https://download.eclipse.org/microprofile/microprofile-rest-client-4.0/microprofile-rest-client-spec-4.0.html#_default_responseexceptionmapper

Each implementation will provide out of the box a ResponseExceptionMapper implementation that will map the response into a WebApplicationException whenever the response status code is >= 400.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants