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

quarkus rest error handling for WebApplicationExceptions and CompletionStage does not work anymore #41996

Closed
robp94 opened this issue Jul 19, 2024 · 0 comments · Fixed by #42003
Labels
area/rest kind/bug Something isn't working
Milestone

Comments

@robp94
Copy link
Contributor

robp94 commented Jul 19, 2024

Describe the bug

Throwing an WebApplicationException like BadRequestException and subscribing as a CompletionStage is not handled correctly anymore. Prior to 3.11.2 it would result in a 400, for example. Since 3.11.2 it results in a 500.

    @GET
    @Produces(MediaType.TEXT_PLAIN)
    @Path("/hello")
    public CompletionStage<String> hello() {
        return Uni.createFrom().<String>failure(new BadRequestException()).subscribeAsCompletionStage();
    }

Expected behavior

Return the correct Status code given by the WebApplicationException.

Actual behavior

Results in a 500 error.

How to Reproduce?

https://github.com/robp94/code-with-quarkus-rest-error-handling

run the included test

Output of uname -a or ver

No response

Output of java -version

21

Quarkus version or git rev

3.11.2+

Build tool (ie. output of mvnw --version or gradlew --version)

No response

Additional information

No response

@robp94 robp94 added the kind/bug Something isn't working label Jul 19, 2024
geoand added a commit to geoand/quarkus that referenced this issue Jul 19, 2024
geoand added a commit that referenced this issue Jul 19, 2024
Unwrap CompletionException when dealing with CompletionStage in REST server
@quarkus-bot quarkus-bot bot added this to the 3.14 - main milestone Jul 19, 2024
@gsmet gsmet modified the milestones: 3.14 - main, 3.13.0 Jul 22, 2024
gsmet pushed a commit to gsmet/quarkus that referenced this issue Jul 22, 2024
barreiro pushed a commit to barreiro/quarkus that referenced this issue Jul 25, 2024
holly-cummins pushed a commit to holly-cummins/quarkus that referenced this issue Jul 31, 2024
danielsoro pushed a commit to danielsoro/quarkus that referenced this issue Sep 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/rest kind/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants